From 7e70e718e113d7b4fe19796a3eb14a9b83b81464 Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Thu, 16 Apr 2026 22:27:04 +0100 Subject: [PATCH 1/9] Update tests, samples, and recordings for azure-planetarycomputer v1.0.0 GA --- .../azure-planetarycomputer/CHANGELOG.md | 2 +- .../azure-planetarycomputer/README.md | 333 +- .../azure-planetarycomputer/_metadata.json | 4 +- .../apiview-properties.json | 245 +- .../azure-planetarycomputer/assets.json | 2 +- .../azure/planetarycomputer/_client.py | 21 +- .../azure/planetarycomputer/_configuration.py | 12 +- .../planetarycomputer/_utils/model_base.py | 20 +- .../azure/planetarycomputer/_validation.py | 66 + .../azure/planetarycomputer/_version.py | 2 +- .../azure/planetarycomputer/aio/_client.py | 21 +- .../planetarycomputer/aio/_configuration.py | 12 +- .../aio/operations/__init__.py | 4 +- .../aio/operations/_operations.py | 24498 +++++++-- .../planetarycomputer/models/__init__.py | 22 +- .../azure/planetarycomputer/models/_enums.py | 198 + .../azure/planetarycomputer/models/_models.py | 407 +- .../planetarycomputer/operations/__init__.py | 4 +- .../operations/_operations.py | 41154 +++++++++++++--- .../ingestion_operations_delete.py | 40 + .../ingestion_operations_delete_all.py | 38 + .../ingestion_operations_get.py | 41 + .../ingestion_operations_list.py | 40 + .../ingestion_runs_create.py | 42 + .../generated_samples/ingestion_runs_get.py | 43 + .../generated_samples/ingestion_runs_list.py | 43 + .../ingestion_sources_create.py | 48 + .../ingestion_sources_delete.py | 40 + .../ingestion_sources_get.py | 41 + .../ingestion_sources_list.py | 40 + ...gestion_sources_list_managed_identities.py | 40 + .../ingestion_sources_replace.py | 49 + .../generated_samples/ingestions_create.py | 49 + .../generated_samples/ingestions_delete.py | 41 + .../generated_samples/ingestions_get.py | 42 + .../generated_samples/ingestions_list.py | 42 + .../ingestions_stac_create_geoparquet.py | 49 + .../generated_samples/ingestions_update.py | 43 + .../maps_class_map_legends_get.py | 41 + ..._interval_legends_get_by_class_map_name.py | 41 + .../generated_samples/maps_legends_get.py | 41 + ...ections_assets_for_bbox_get_bbox_assets.py | 45 + ...ets_for_tile_matrix_sets_get_zxy_assets.py | 45 + ...ections_assets_for_tiles_get_zxy_assets.py | 44 + ...ctions_bbox_get_cropped_to_bounding_box.py | 46 + ...cropped_to_bounding_box_width_by_height.py | 48 + ...osaic_collections_feature_geo_json_crop.py | 57 + ...ons_feature_geo_json_format_crop_format.py | 58 + ...h_by_height_crop_width_by_height_format.py | 60 + .../mosaic_collections_info_get.py | 41 + ...llections_point_assets_get_point_assets.py | 43 + .../mosaic_collections_point_get_point.py | 43 + .../mosaic_collections_tile_json_get.py | 41 + ...le_matrix_sets_format_get_zxy_by_format.py | 46 + ...ile_matrix_sets_get_zxy_scale_by_format.py | 47 + ...lections_tile_matrix_sets_plain_get_zxy.py | 45 + ...tile_matrix_sets_scale_get_zxy_by_scale.py | 46 + ...lections_tile_matrix_sets_tile_json_get.py | 42 + .../mosaic_collections_tile_set_list_get.py | 41 + ...osaic_collections_tile_set_metadata_get.py | 42 + ...lections_tiles_format_get_zxy_by_format.py | 45 + ...llections_tiles_get_zxy_scale_by_format.py | 46 + .../mosaic_collections_tiles_plain_get_zxy.py | 44 + ...ollections_tiles_scale_get_zxy_by_scale.py | 45 + ...c_collections_wmts_get_capabilities_xml.py | 41 + ...s_tile_matrix_sets_get_capabilities_xml.py | 42 + .../mosaic_items_asset_statistics_get_all.py | 42 + .../mosaic_items_available_assets_get_all.py | 42 + ..._items_bbox_get_cropped_to_bounding_box.py | 47 + ...cropped_to_bounding_box_width_by_height.py | 49 + .../mosaic_items_bounds_get_all.py | 42 + .../mosaic_items_feature_geo_json_crop.py | 58 + ...ems_feature_geo_json_format_crop_format.py | 59 + ...h_by_height_crop_width_by_height_format.py | 61 + .../mosaic_items_geo_json_statistics_get.py | 58 + .../mosaic_items_info_geo_json_get.py | 42 + .../mosaic_items_info_get.py | 42 + .../mosaic_items_point_get_point.py | 44 + .../mosaic_items_preview_format_get_format.py | 43 + .../mosaic_items_preview_get.py | 42 + .../mosaic_items_statistics_get_all.py | 42 + .../mosaic_items_tile_json_get.py | 42 + ...le_matrix_sets_format_get_zxy_by_format.py | 47 + ...ic_items_tile_matrix_sets_plain_get_zxy.py | 46 + ...scale_by_format_get_zxy_scale_by_format.py | 48 + ...tile_matrix_sets_scale_get_zxy_by_scale.py | 47 + ...ic_items_tile_matrix_sets_tile_json_get.py | 43 + .../mosaic_items_tile_set_list_get.py | 42 + .../mosaic_items_tile_set_metadata_get.py | 43 + ...ic_items_tiles_format_get_zxy_by_format.py | 46 + .../mosaic_items_tiles_plain_get_zxy.py | 45 + ...scale_by_format_get_zxy_scale_by_format.py | 47 + ...saic_items_tiles_scale_get_zxy_by_scale.py | 46 + .../mosaic_items_wmts_get_capabilities_xml.py | 42 + ...s_tile_matrix_sets_get_capabilities_xml.py | 43 + ...earches_assets_for_bbox_get_bbox_assets.py | 45 + ...ets_for_tile_matrix_sets_get_zxy_assets.py | 46 + ...earches_assets_for_tiles_get_zxy_assets.py | 44 + ...arches_bbox_get_cropped_to_bounding_box.py | 46 + ...cropped_to_bounding_box_width_by_height.py | 48 + .../mosaic_searches_feature_geo_json_crop.py | 57 + ...hes_feature_geo_json_format_crop_format.py | 58 + ...h_by_height_crop_width_by_height_format.py | 60 + .../mosaic_searches_info_search_get.py | 41 + .../mosaic_searches_point_get_point.py | 43 + ...ches_point_with_assets_get_point_assets.py | 43 + .../mosaic_searches_tile_json_get.py | 41 + ...le_matrix_sets_format_get_zxy_by_format.py | 46 + ...ile_matrix_sets_get_zxy_scale_by_format.py | 47 + ...searches_tile_matrix_sets_plain_get_zxy.py | 45 + ...tile_matrix_sets_scale_get_zxy_by_scale.py | 46 + ...searches_tile_matrix_sets_tile_json_get.py | 42 + .../mosaic_searches_tile_set_list_get.py | 41 + .../mosaic_searches_tile_set_metadata_get.py | 42 + ...searches_tiles_format_get_zxy_by_format.py | 45 + ..._searches_tiles_get_zxy_scale_by_format.py | 46 + .../mosaic_searches_tiles_plain_get_zxy.py | 44 + ...c_searches_tiles_scale_get_zxy_by_scale.py | 45 + ...saic_searches_wmts_get_capabilities_xml.py | 41 + ...s_tile_matrix_sets_get_capabilities_xml.py | 42 + .../mosaics_register_search_register.py | 52 + .../generated_samples/sas_get_sign.py | 41 + .../generated_samples/sas_get_token.py | 41 + .../generated_samples/sas_revoke_token.py | 38 + .../stac_collection_assets_create.py | 45 + .../stac_collection_assets_delete.py | 42 + .../stac_collection_assets_replace.py | 46 + .../stac_collection_config_get.py | 41 + .../stac_collection_mosaics_add.py | 42 + .../stac_collection_mosaics_delete.py | 41 + .../stac_collection_mosaics_get.py | 42 + .../stac_collection_mosaics_get_all.py | 41 + .../stac_collection_mosaics_replace.py | 48 + .../stac_collection_partition_types_get.py | 41 + ...stac_collection_partition_types_replace.py | 41 + .../stac_collection_render_options_create.py | 48 + .../stac_collection_render_options_delete.py | 41 + .../stac_collection_render_options_get.py | 42 + .../stac_collection_render_options_get_all.py | 41 + .../stac_collection_render_options_replace.py | 50 + .../stac_collection_thumbnails_get.py | 41 + .../stac_collection_tile_settings_get.py | 41 + .../stac_collection_tile_settings_replace.py | 42 + .../stac_collections_create.py | 52 + .../stac_collections_create_or_replace.py | 78 + .../stac_collections_delete.py | 40 + .../generated_samples/stac_collections_get.py | 41 + .../stac_collections_get_all.py | 39 + .../stac_collections_replace.py | 78 + .../stac_conformance_class_get.py | 39 + .../generated_samples/stac_items_create.py | 86 + .../stac_items_create_or_replace.py | 89 + .../generated_samples/stac_items_delete.py | 41 + .../generated_samples/stac_items_get.py | 42 + .../stac_items_get_features.py | 41 + .../generated_samples/stac_items_replace.py | 89 + .../generated_samples/stac_items_update.py | 105 + .../stac_landing_pages_get.py | 39 + .../stac_queryables_create.py | 49 + .../stac_queryables_delete.py | 41 + .../stac_queryables_get_all.py | 39 + .../stac_queryables_get_all_by_collection.py | 41 + .../stac_queryables_replace.py | 48 + .../generated_samples/stac_search_create.py | 65 + .../tile_matrix_definitions_get.py | 41 + .../generated_samples/tile_matrix_list_get.py | 39 + .../generated_tests/conftest.py | 45 + ..._planetary_computer_pro_data_operations.py | 1204 + ...tary_computer_pro_data_operations_async.py | 1205 + ...etary_computer_pro_ingestion_operations.py | 243 + ...computer_pro_ingestion_operations_async.py | 246 + ...t_planetary_computer_pro_sas_operations.py | 44 + ...etary_computer_pro_sas_operations_async.py | 45 + ..._pro_shared_access_signature_operations.py | 44 + ...hared_access_signature_operations_async.py | 45 + ..._planetary_computer_pro_stac_operations.py | 809 + ...tary_computer_pro_stac_operations_async.py | 822 + .../generated_tests/testpreparer.py | 28 + .../generated_tests/testpreparer_async.py | 20 + .../azure-planetarycomputer/pyproject.toml | 8 + ...etary_computer_00_stac_collection_async.py | 103 +- ..._computer_01_ingestion_management_async.py | 106 +- ...ry_computer_02_stac_specification_async.py | 88 +- ...mputer_03_shared_access_signature_async.py | 18 +- ...etary_computer_04_stac_item_tiler_async.py | 136 +- ...anetary_computer_05_mosaics_tiler_async.py | 145 +- ...planetary_computer_06_map_legends_async.py | 8 +- .../planetary_computer_00_stac_collection.py | 85 +- ...netary_computer_01_ingestion_management.py | 7 +- ...lanetary_computer_02_stac_specification.py | 80 +- ...ary_computer_03_shared_access_signature.py | 6 +- .../planetary_computer_04_stac_item_tiler.py | 94 +- .../planetary_computer_05_mosaics_tiler.py | 135 +- .../planetary_computer_06_map_legends.py | 8 +- .../azure-planetarycomputer/test.py | 18 + .../test_cancel_all_operations.py | 165 + .../test_collection_status_code.py | 95 + .../test_readme_samples.py | 363 + .../azure-planetarycomputer/tests/conftest.py | 40 +- .../collection_lifecycle_test_results.log | 0 .../collection_tiler_async_test_results.log | 0 .../logs/collection_tiler_test_results.log | 0 .../tests/logs/ingestion_test_results.log | 0 .../tests/logs/map_legends_test_results.log | 0 .../tests/logs/mosaics_tiler_test_results.log | 0 .../tests/logs/sas_test_results.log | 0 .../logs/stac_collection_test_results.log | 0 .../logs/stac_item_tiler_test_results.log | 0 .../logs/stac_specification_test_results.log | 0 ...t_planetary_computer_00_stac_collection.py | 372 +- ...etary_computer_00_stac_collection_async.py | 352 +- ...netary_computer_01_ingestion_management.py | 228 +- ..._computer_01_ingestion_management_async.py | 235 +- ...lanetary_computer_02_stac_specification.py | 358 +- ...ry_computer_02_stac_specification_async.py | 362 +- .../tests/test_planetary_computer_03_sas.py | 120 +- .../test_planetary_computer_03_sas_async.py | 112 +- ...t_planetary_computer_04_stac_item_tiler.py | 189 +- ...etary_computer_04_stac_item_tiler_async.py | 191 +- ...est_planetary_computer_05_mosaics_tiler.py | 444 +- ...anetary_computer_05_mosaics_tiler_async.py | 472 +- .../test_planetary_computer_06_map_legends.py | 108 +- ...planetary_computer_06_map_legends_async.py | 112 +- ...netary_computer_07_collection_lifecycle.py | 103 +- ..._computer_07_collection_lifecycle_async.py | 111 +- ..._planetary_computer_08_collection_tiler.py | 325 + ...tary_computer_08_collection_tiler_async.py | 337 + .../tests/testpreparer.py | 2 +- .../azure-planetarycomputer/tsp-location.yaml | 2 +- 229 files changed, 70229 insertions(+), 14652 deletions(-) create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_validation.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_list.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_list.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list_managed_identities.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_list.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_stac_create_geoparquet.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_update.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_class_map_legends_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_interval_legends_get_by_class_map_name.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_legends_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_bbox_get_bbox_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tile_matrix_sets_get_zxy_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tiles_get_zxy_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_get_cropped_to_bounding_box.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_crop.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_format_crop_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_width_by_height_crop_width_by_height_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_info_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_assets_get_point_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_get_point.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_format_get_zxy_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_get_zxy_scale_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_plain_get_zxy.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_scale_get_zxy_by_scale.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_tile_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_list_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_metadata_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_format_get_zxy_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_get_zxy_scale_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_plain_get_zxy.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_scale_get_zxy_by_scale.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_get_capabilities_xml.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_tile_matrix_sets_get_capabilities_xml.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_asset_statistics_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_available_assets_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_get_cropped_to_bounding_box.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bounds_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_crop.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_format_crop_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_width_by_height_crop_width_by_height_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_geo_json_statistics_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_geo_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_point_get_point.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_format_get_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_statistics_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_format_get_zxy_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_plain_get_zxy.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_by_format_get_zxy_scale_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_get_zxy_by_scale.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_tile_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_list_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_metadata_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_format_get_zxy_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_plain_get_zxy.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_by_format_get_zxy_scale_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_get_zxy_by_scale.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_get_capabilities_xml.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_tile_matrix_sets_get_capabilities_xml.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_bbox_get_bbox_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tile_matrix_sets_get_zxy_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tiles_get_zxy_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_get_cropped_to_bounding_box.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_crop.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_format_crop_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_width_by_height_crop_width_by_height_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_info_search_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_get_point.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_with_assets_get_point_assets.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_format_get_zxy_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_get_zxy_scale_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_plain_get_zxy.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_scale_get_zxy_by_scale.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_tile_json_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_list_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_metadata_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_format_get_zxy_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_get_zxy_scale_by_format.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_plain_get_zxy.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_scale_get_zxy_by_scale.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_get_capabilities_xml.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_tile_matrix_sets_get_capabilities_xml.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaics_register_search_register.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_sign.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_token.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_revoke_token.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_config_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_add.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_thumbnails_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create_or_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_conformance_class_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create_or_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get_features.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_update.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_landing_pages_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_delete.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all_by_collection.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_replace.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_search_create.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_definitions_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_list_get.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/conftest.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations_async.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations_async.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations_async.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations_async.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations_async.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer_async.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py diff --git a/sdk/planetarycomputer/azure-planetarycomputer/CHANGELOG.md b/sdk/planetarycomputer/azure-planetarycomputer/CHANGELOG.md index 4f60234107db..57fba6fd0c2e 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/CHANGELOG.md +++ b/sdk/planetarycomputer/azure-planetarycomputer/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0b1 (Unreleased) +## 1.0.0 (2026-04-14) ### Features Added diff --git a/sdk/planetarycomputer/azure-planetarycomputer/README.md b/sdk/planetarycomputer/azure-planetarycomputer/README.md index 1620d4f94cc0..c3a54040640c 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/README.md +++ b/sdk/planetarycomputer/azure-planetarycomputer/README.md @@ -92,7 +92,7 @@ client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential) - **Ingestion Runs**: Create and monitor ingestion runs with detailed operation tracking - **Partition Configuration**: Configure how data is partitioned and processed during ingestion -#### Shared Access Signature Operations (`client.shared_access_signature`) +#### Shared Access Signature Operations (`client.sas`) - **Token Generation**: Generate SAS tokens with configurable duration for collections to enable secure access - **Asset Signing**: Sign asset HREFs for secure downloads of managed storage assets @@ -102,6 +102,19 @@ client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential) The following section provides several code snippets covering common GeoCatalog workflows. For complete working examples, see the [samples][pc_samples] directory. +- [List STAC collections](#list-stac-collections) +- [Search for STAC items](#search-for-stac-items) +- [Get STAC item details](#get-stac-item-details) +- [Create a STAC collection](#create-stac-collection) +- [Configure collection visualization](#configure-collection-visualization) +- [Register and render mosaic tiles](#register-and-render-mosaic-tiles) +- [Extract point values](#extract-point-values) +- [Generate map tiles](#generate-map-tiles) +- [Set up ingestion sources](#set-up-ingestion-sources) +- [Data ingestion management](#data-ingestion-management) +- [Generate SAS token for secure access](#generate-sas-token-for-secure-access) +- [Async operations](#async-operations) + ### List STAC Collections List all available STAC collections: @@ -115,7 +128,7 @@ endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) # List all collections -collections_response = client.stac.list_collections() +collections_response = client.stac.get_collections() for collection in collections_response.collections: print(f"Collection: {collection.id}") @@ -158,7 +171,7 @@ search_params = StacSearchParameters( limit=10 ) -search_result = client.stac.search_items(body=search_params) +search_result = client.stac.search(body=search_params) print(f"Found {len(search_result.features)} items") ``` @@ -193,38 +206,124 @@ from azure.planetarycomputer import PlanetaryComputerProClient from azure.planetarycomputer.models import ( StacCollection, StacExtensionSpatialExtent, - StacExtensionTemporalExtent, - StacExtent + StacCollectionTemporalExtent, + StacExtensionExtent, ) from azure.identity import DefaultAzureCredential endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) -# Define collection with proper extent -spatial_extent = StacExtensionSpatialExtent(bbox=[[-180.0, -90.0, 180.0, 90.0]]) -temporal_extent = StacExtensionTemporalExtent(interval=[["2023-01-01T00:00:00Z", None]]) - +# Define collection collection = StacCollection( id="my-collection", - type="Collection", - stac_version="1.0.0", description="A collection of geospatial data", license="proprietary", - extent=StacExtent( - spatial=spatial_extent, - temporal=temporal_extent + extent=StacExtensionExtent( + spatial=StacExtensionSpatialExtent(bounding_box=[[-180.0, -90.0, 180.0, 90.0]]), + temporal=StacCollectionTemporalExtent(interval=[[None, None]]), ), - links=[] + links=[], + stac_version="1.0.0", + type="Collection", ) -# Create the collection -created_collection = client.stac.create_or_update_collection( - collection_id="my-collection", - body=collection +# Create the collection (long-running operation) +poller = client.stac.begin_create_collection(body=collection) +poller.result() # Wait for completion + +print(f"Created collection: {collection.id}") +``` + +### Configure Collection Visualization + +Configure render options and tile settings to control how collection data is displayed: + +```python +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.planetarycomputer.models import RenderOption, TileSettings +from azure.identity import DefaultAzureCredential + +endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" +client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) + +collection_id = "my-collection" + +# Add a render option for visualizing data +render_option = RenderOption( + id="true-color", + name="True Color", + type="raster-tile", + options="assets=image&rescale=0,255", +) +client.stac.create_render_option(collection_id=collection_id, body=render_option) + +# Configure tile settings +tile_settings = TileSettings(min_zoom=6, max_items_per_tile=10) +client.stac.replace_tile_settings(collection_id=collection_id, body=tile_settings) + +# List all render options +for option in client.stac.list_render_options(collection_id=collection_id): + print(f"Render option: {option.id} - {option.name}") +``` + +### Register and Render Mosaic Tiles + +Register a STAC search as a mosaic and retrieve tiles from it: + +```python +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.identity import DefaultAzureCredential + +endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" +client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) + +# Register a mosaic search +registration = client.data.register_mosaics_search( + body={ + "collections": ["naip"], + "filter-lang": "cql2-json", + "filter": { + "op": "=", + "args": [{"property": "naip:year"}, "2021"] + }, + } ) +print(f"Search ID: {registration.search_id}") -print(f"Created collection: {created_collection.id}") +# Get TileJSON metadata for the registered mosaic +tile_json = client.data.get_searches_tile_json( + search_id=registration.search_id, + tile_matrix_set_id="WebMercatorQuad", + assets=["image"], +) +print(f"Tile URLs: {tile_json.tiles}") +print(f"Bounds: {tile_json.bounds}") +``` + +### Extract Point Values + +Extract pixel values at a specific geographic coordinate: + +```python +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.identity import DefaultAzureCredential + +endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" +client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) + +# Get pixel values at a coordinate for a specific item +point_data = client.data.get_item_point( + collection_id="naip", + item_id="ga_m_3308421_se_16_060_20211114", + longitude=-84.41, + latitude=33.65, + assets=["image"], +) + +print(f"Coordinates: {point_data.coordinates}") +print(f"Band names: {point_data.band_names}") +print(f"Values: {point_data.values_property}") ``` ### Generate Map Tiles @@ -242,14 +341,15 @@ collection_id = "naip" item_id = "ga_m_3308421_se_16_060_20211114" # Get a specific tile for the item -tile_response = client.data.get_item_tile( +tile_response = client.data.get_tile( collection_id=collection_id, item_id=item_id, tile_matrix_set_id="WebMercatorQuad", z=14, # Zoom level x=4322, # Tile X coordinate y=6463, # Tile Y coordinate - assets=["image"] + assets=["image"], + format="png", ) # Save tile to file @@ -258,37 +358,73 @@ with open("tile.png", "wb") as f: f.write(chunk) ``` +### Set Up Ingestion Sources + +Configure data sources for ingestion using Managed Identity or SAS token authentication: + +```python +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.planetarycomputer.models import ( + ManagedIdentityIngestionSource, + ManagedIdentityConnection, +) +from azure.identity import DefaultAzureCredential + +endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" +client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) + +# Create a Managed Identity ingestion source +source = ManagedIdentityIngestionSource( + id="my-storage-source", + connection_info=ManagedIdentityConnection( + container_uri="https://mystorage.blob.core.windows.net/geospatial-data", + object_id="00000000-0000-0000-0000-000000000000", + ), +) +created_source = client.ingestion.create_source(body=source) +print(f"Created source: {created_source.id}") + +# List available managed identities +for identity in client.ingestion.list_managed_identities(): + print(f"Identity: {identity.object_id} - {identity.resource_id}") + +# List all configured sources +for src in client.ingestion.list_sources(): + print(f"Source: {src.id} ({src.kind})") +``` + ### Data Ingestion Management Manage data ingestion operations: ```python from azure.planetarycomputer import PlanetaryComputerProClient -from azure.planetarycomputer.models import IngestionJob, PartitionType +from azure.planetarycomputer.models import IngestionDefinition, IngestionType from azure.identity import DefaultAzureCredential endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) -# Create an ingestion job -ingestion_job = IngestionJob( - collection_id="my-collection", - partition_type=PartitionType.YEAR_MONTH, - description="Ingestion job for geospatial data" +# Create an ingestion definition +ingestion = IngestionDefinition( + id="my-ingestion-001", + import_type=IngestionType.STATIC_CATALOG, + display_name="My data ingestion", + source_catalog_url="https://example.com/catalog.json", ) -created_job = client.ingestion.create_or_update_job( - job_id="ingestion-job-001", - body=ingestion_job +created = client.ingestion.create( + collection_id="my-collection", + body=ingestion, ) -print(f"Created job: {created_job.id}") -print(f"Status: {created_job.status}") +print(f"Created ingestion: {created.id}") +print(f"Status: {created.status}") -# List all ingestion jobs -jobs = client.ingestion.list_jobs() -for job in jobs.value: - print(f"Job: {job.id} - Status: {job.status}") +# List all ingestions for a collection +ingestions = client.ingestion.list(collection_id="my-collection") +for ing in ingestions: + print(f"Ingestion: {ing.id} - Status: {ing.status}") ``` ### Generate SAS Token for Secure Access @@ -297,46 +433,92 @@ Generate Shared Access Signatures for secure data access: ```python from azure.planetarycomputer import PlanetaryComputerProClient -from azure.planetarycomputer.models import SignedUrlRequest, AccessPermission from azure.identity import DefaultAzureCredential -from datetime import datetime, timedelta endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) -# Generate a SAS token for a collection -sas_request = SignedUrlRequest( - permissions=[AccessPermission.READ], - expires_on=datetime.utcnow() + timedelta(hours=1) +# Generate a SAS token for a collection (valid for 60 minutes) +token_response = client.sas.get_token( + collection_id="naip", + duration_in_minutes=60, ) -sas_response = client.shared_access_signature.generate_collection_signed_url( - collection_id="naip", - body=sas_request +print(f"SAS Token: {token_response.token}") +print(f"Expiry: {token_response.expires_on}") + +# Sign an asset HREF for secure download +signed = client.sas.get_sign( + href="https://storage.blob.core.windows.net/container/path/to/asset.tif", + duration_in_minutes=60, ) -print(f"SAS URL: {sas_response.url}") -print(f"Expires on: {sas_response.expires_on}") +print(f"Signed URL: {signed.href}") +``` + +### Async Operations + +All operations are also available as async. Use `aio` for the async client: + +```python +import asyncio +from azure.planetarycomputer.aio import PlanetaryComputerProClient +from azure.identity.aio import DefaultAzureCredential + +async def main(): + endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" + credential = DefaultAzureCredential() + + async with PlanetaryComputerProClient(endpoint=endpoint, credential=credential) as client: + # List collections + collections_response = await client.stac.get_collections() + for collection in collections_response.collections: + print(f"Collection: {collection.id}") + + # Get a specific item + item = await client.stac.get_item( + collection_id="naip", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(f"Item: {item.id}") + + await credential.close() + +asyncio.run(main()) ``` -### Troubleshooting +## Troubleshooting ### General Planetary Computer client library will raise exceptions defined in [Azure Core][python_azure_core_exceptions]. -Error codes and messages raised by the GeoCatalog service can be found in the service documentation. + +```python +from azure.core.exceptions import HttpResponseError +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.identity import DefaultAzureCredential + +client = PlanetaryComputerProClient( + endpoint="https://your-endpoint.geocatalog.spatio.azure.com", + credential=DefaultAzureCredential(), +) + +try: + client.stac.get_collection(collection_id="non-existent-collection") +except HttpResponseError as e: + print(f"Status code: {e.status_code}") + print(f"Reason: {e.reason}") + print(f"Message: {e.message}") +``` ### Logging This library uses the standard [logging][python_logging] library for logging. - Basic information about HTTP sessions (URLs, headers, etc.) is logged at `INFO` level. Detailed `DEBUG` level logging, including request/response bodies and **unredacted** headers, can be enabled on the client or per-operation with the `logging_enable` keyword argument. -See full SDK logging documentation with examples in the [Azure SDK documentation][sdk_logging_docs]. - ```python import sys import logging @@ -344,22 +526,24 @@ import logging from azure.planetarycomputer import PlanetaryComputerProClient from azure.identity import DefaultAzureCredential -logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', - stream=sys.stdout) +# Enable DEBUG logging for all SDK calls +logging.basicConfig(level=logging.DEBUG, stream=sys.stdout) -endpoint = "https://your-endpoint.geocatalog.spatio.azure.com" -credential = DefaultAzureCredential() -client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential) +client = PlanetaryComputerProClient( + endpoint="https://your-endpoint.geocatalog.spatio.azure.com", + credential=DefaultAzureCredential(), +) -# Enable logging for a specific operation +# Or enable logging for a single operation item = client.stac.get_item( collection_id="naip", item_id="ga_m_3308421_se_16_060_20211114", - logging_enable=True + logging_enable=True, ) ``` +See full SDK logging documentation in the [Azure SDK documentation][sdk_logging_docs]. + ### Optional Configuration Optional keyword arguments can be passed in at the client and per-operation level. @@ -369,7 +553,17 @@ The azure-core [reference documentation][azure_core_ref_docs] describes availabl ### More sample code -See the `samples` directory for several code snippets illustrating common patterns for working with GeoCatalog resources. +For complete working examples, see the individual sample files: + +| Scenario | Sync | Async | +|---|---|---| +| STAC Collection Management | [sample][sample_00] | [async sample][sample_00_async] | +| Ingestion Management | [sample][sample_01] | [async sample][sample_01_async] | +| STAC Specification (Items, Search) | [sample][sample_02] | [async sample][sample_02_async] | +| Shared Access Signatures | [sample][sample_03] | [async sample][sample_03_async] | +| STAC Item Tiler | [sample][sample_04] | [async sample][sample_04_async] | +| Mosaics Tiler | [sample][sample_05] | [async sample][sample_05_async] | +| Map Legends | [sample][sample_06] | [async sample][sample_06_async] | ### Additional documentation @@ -409,6 +603,21 @@ additional questions or comments. [sdk_logging_docs]: https://learn.microsoft.com/azure/developer/python/sdk/azure-sdk-logging [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs +[sample_00]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_00_stac_collection.py +[sample_00_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_00_stac_collection_async.py +[sample_01]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_01_ingestion_management.py +[sample_01_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_01_ingestion_management_async.py +[sample_02]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_02_stac_specification.py +[sample_02_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_02_stac_specification_async.py +[sample_03]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_03_shared_access_signature.py +[sample_03_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_03_shared_access_signature_async.py +[sample_04]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_04_stac_item_tiler.py +[sample_04_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py +[sample_05]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py +[sample_05_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py +[sample_06]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_06_map_legends.py +[sample_06_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_06_map_legends_async.py + [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [microsoft_cla]: https://cla.microsoft.com [opencode_email]: mailto:opencode@microsoft.com diff --git a/sdk/planetarycomputer/azure-planetarycomputer/_metadata.json b/sdk/planetarycomputer/azure-planetarycomputer/_metadata.json index 7443c6a23ddd..aeb25bf60e3f 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/_metadata.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/_metadata.json @@ -1,6 +1,6 @@ { - "apiVersion": "2025-04-30-preview", + "apiVersion": "2026-04-15", "apiVersions": { - "Microsoft.PlanetaryComputer": "2025-04-30-preview" + "Microsoft.PlanetaryComputer": "2026-04-15" } } \ No newline at end of file diff --git a/sdk/planetarycomputer/azure-planetarycomputer/apiview-properties.json b/sdk/planetarycomputer/azure-planetarycomputer/apiview-properties.json index e7d73c6b5fb4..b71771de6cae 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/apiview-properties.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/apiview-properties.json @@ -10,8 +10,6 @@ "azure.planetarycomputer.models.ErrorInfo": "Microsoft.PlanetaryComputer.ErrorInfo", "azure.planetarycomputer.models.Feature": "Feature", "azure.planetarycomputer.models.Geometry": "Geometry", - "azure.planetarycomputer.models.ImageParameters": "Microsoft.PlanetaryComputer.ImageParameters", - "azure.planetarycomputer.models.ImageResponse": "Microsoft.PlanetaryComputer.ImageResponse", "azure.planetarycomputer.models.IngestionDefinition": "Microsoft.PlanetaryComputer.IngestionDefinition", "azure.planetarycomputer.models.IngestionRun": "Microsoft.PlanetaryComputer.IngestionRun", "azure.planetarycomputer.models.IngestionRunOperation": "Microsoft.PlanetaryComputer.IngestionRunOperation", @@ -70,6 +68,7 @@ "azure.planetarycomputer.models.TileMatrix": "TileMatrix", "azure.planetarycomputer.models.TileMatrixSet": "TileMatrixSet", "azure.planetarycomputer.models.TileMatrixSetBoundingBox": "TileMatrixSetBoundingBox", + "azure.planetarycomputer.models.TileMatrixSetLimitsEntry": "Microsoft.PlanetaryComputer.TileMatrixSetLimitsEntry", "azure.planetarycomputer.models.TilerAssetGeoJson": "Microsoft.PlanetaryComputer.TilerAssetGeoJson", "azure.planetarycomputer.models.TilerCoreModelsResponsesPoint": "Microsoft.PlanetaryComputer.TilerCoreModelsResponsesPoint", "azure.planetarycomputer.models.TilerInfo": "Microsoft.PlanetaryComputer.TilerInfo", @@ -79,6 +78,11 @@ "azure.planetarycomputer.models.TilerStacItemStatistics": "Microsoft.PlanetaryComputer.TilerStacItemStatistics", "azure.planetarycomputer.models.TilerStacSearchDefinition": "Microsoft.PlanetaryComputer.TilerStacSearchDefinition", "azure.planetarycomputer.models.TilerStacSearchRegistration": "Microsoft.PlanetaryComputer.TilerStacSearchRegistration", + "azure.planetarycomputer.models.TileSetBoundingBox": "Microsoft.PlanetaryComputer.TileSetBoundingBox", + "azure.planetarycomputer.models.TileSetEntry": "Microsoft.PlanetaryComputer.TileSetEntry", + "azure.planetarycomputer.models.TileSetLink": "Microsoft.PlanetaryComputer.TileSetLink", + "azure.planetarycomputer.models.TileSetList": "Microsoft.PlanetaryComputer.TileSetList", + "azure.planetarycomputer.models.TileSetMetadata": "Microsoft.PlanetaryComputer.TileSetMetadata", "azure.planetarycomputer.models.TileSettings": "Microsoft.PlanetaryComputer.TileSettings", "azure.planetarycomputer.models.UserCollectionSettings": "Microsoft.PlanetaryComputer.UserCollectionSettings", "azure.planetarycomputer.models.VariableMatrixWidth": "VariableMatrixWidth", @@ -97,14 +101,17 @@ "azure.planetarycomputer.models.StacSearchSortingDirection": "Microsoft.PlanetaryComputer.StacSearchSortingDirection", "azure.planetarycomputer.models.FilterLanguage": "Microsoft.PlanetaryComputer.FilterLanguage", "azure.planetarycomputer.models.TileMatrixCornerOfOrigin": "TileMatrixCornerOfOrigin", - "azure.planetarycomputer.models.Resampling": "Microsoft.PlanetaryComputer.Resampling", + "azure.planetarycomputer.models.MosaicMetadataType": "Microsoft.PlanetaryComputer.MosaicMetadataType", + "azure.planetarycomputer.models.SelMethod": "Microsoft.PlanetaryComputer.SelMethod", + "azure.planetarycomputer.models.WarpKernelResampling": "Microsoft.PlanetaryComputer.WarpKernelResampling", "azure.planetarycomputer.models.TerrainAlgorithm": "Microsoft.PlanetaryComputer.TerrainAlgorithm", + "azure.planetarycomputer.models.TilerImageFormat": "Microsoft.PlanetaryComputer.TilerImageFormat", + "azure.planetarycomputer.models.Resampling": "Microsoft.PlanetaryComputer.Resampling", "azure.planetarycomputer.models.ColorMapNames": "Microsoft.PlanetaryComputer.ColorMapNames", + "azure.planetarycomputer.models.TileMatrixSetId": "Microsoft.PlanetaryComputer.TileMatrixSetId", "azure.planetarycomputer.models.FeatureType": "FeatureType", "azure.planetarycomputer.models.NoDataType": "Microsoft.PlanetaryComputer.NoDataType", - "azure.planetarycomputer.models.TilerImageFormat": "Microsoft.PlanetaryComputer.TilerImageFormat", "azure.planetarycomputer.models.TileAddressingScheme": "Microsoft.PlanetaryComputer.TileAddressingScheme", - "azure.planetarycomputer.models.MosaicMetadataType": "Microsoft.PlanetaryComputer.MosaicMetadataType", "azure.planetarycomputer.models.PixelSelection": "Microsoft.PlanetaryComputer.PixelSelection", "azure.planetarycomputer.operations.IngestionOperations.cancel_operation": "Customizations.Ingestion.cancelOperation", "azure.planetarycomputer.aio.operations.IngestionOperations.cancel_operation": "Customizations.Ingestion.cancelOperation", @@ -162,8 +169,8 @@ "azure.planetarycomputer.aio.operations.StacOperations.list_mosaics": "Customizations.Stac.listMosaics", "azure.planetarycomputer.operations.StacOperations.begin_create_collection": "Customizations.Stac.createCollection", "azure.planetarycomputer.aio.operations.StacOperations.begin_create_collection": "Customizations.Stac.createCollection", - "azure.planetarycomputer.operations.StacOperations.create_or_replace_collection": "Customizations.Stac.createOrReplaceCollection", - "azure.planetarycomputer.aio.operations.StacOperations.create_or_replace_collection": "Customizations.Stac.createOrReplaceCollection", + "azure.planetarycomputer.operations.StacOperations.replace_collection": "Customizations.Stac.replaceCollection", + "azure.planetarycomputer.aio.operations.StacOperations.replace_collection": "Customizations.Stac.replaceCollection", "azure.planetarycomputer.operations.StacOperations.begin_delete_collection": "Customizations.Stac.deleteCollection", "azure.planetarycomputer.aio.operations.StacOperations.begin_delete_collection": "Customizations.Stac.deleteCollection", "azure.planetarycomputer.operations.StacOperations.get_collection": "Customizations.Stac.getCollection", @@ -196,8 +203,8 @@ "azure.planetarycomputer.aio.operations.StacOperations.get_landing_page": "Customizations.Stac.getLandingPage", "azure.planetarycomputer.operations.StacOperations.begin_create_item": "Customizations.Stac.createItem", "azure.planetarycomputer.aio.operations.StacOperations.begin_create_item": "Customizations.Stac.createItem", - "azure.planetarycomputer.operations.StacOperations.begin_create_or_replace_item": "Customizations.Stac.createOrReplaceItem", - "azure.planetarycomputer.aio.operations.StacOperations.begin_create_or_replace_item": "Customizations.Stac.createOrReplaceItem", + "azure.planetarycomputer.operations.StacOperations.begin_replace_item": "Customizations.Stac.replaceItem", + "azure.planetarycomputer.aio.operations.StacOperations.begin_replace_item": "Customizations.Stac.replaceItem", "azure.planetarycomputer.operations.StacOperations.begin_delete_item": "Customizations.Stac.deleteItem", "azure.planetarycomputer.aio.operations.StacOperations.begin_delete_item": "Customizations.Stac.deleteItem", "azure.planetarycomputer.operations.StacOperations.get_item": "Customizations.Stac.getItem", @@ -222,69 +229,177 @@ "azure.planetarycomputer.aio.operations.DataOperations.get_tile_matrix_definitions": "Customizations.Data.getTileMatrixDefinitions", "azure.planetarycomputer.operations.DataOperations.list_tile_matrices": "Customizations.Data.listTileMatrices", "azure.planetarycomputer.aio.operations.DataOperations.list_tile_matrices": "Customizations.Data.listTileMatrices", - "azure.planetarycomputer.operations.DataOperations.get_asset_statistics": "Customizations.Data.getAssetStatistics", - "azure.planetarycomputer.aio.operations.DataOperations.get_asset_statistics": "Customizations.Data.getAssetStatistics", - "azure.planetarycomputer.operations.DataOperations.list_available_assets": "Customizations.Data.listAvailableAssets", - "azure.planetarycomputer.aio.operations.DataOperations.list_available_assets": "Customizations.Data.listAvailableAssets", - "azure.planetarycomputer.operations.DataOperations.get_bounds": "Customizations.Data.getBounds", - "azure.planetarycomputer.aio.operations.DataOperations.get_bounds": "Customizations.Data.getBounds", - "azure.planetarycomputer.operations.DataOperations.crop_geo_json": "Customizations.Data.cropGeoJson", - "azure.planetarycomputer.aio.operations.DataOperations.crop_geo_json": "Customizations.Data.cropGeoJson", - "azure.planetarycomputer.operations.DataOperations.crop_geo_json_with_dimensions": "Customizations.Data.cropGeoJsonWithDimensions", - "azure.planetarycomputer.aio.operations.DataOperations.crop_geo_json_with_dimensions": "Customizations.Data.cropGeoJsonWithDimensions", - "azure.planetarycomputer.operations.DataOperations.get_geo_json_statistics": "Customizations.Data.getGeoJsonStatistics", - "azure.planetarycomputer.aio.operations.DataOperations.get_geo_json_statistics": "Customizations.Data.getGeoJsonStatistics", - "azure.planetarycomputer.operations.DataOperations.get_info_geo_json": "Customizations.Data.getInfoGeoJson", - "azure.planetarycomputer.aio.operations.DataOperations.get_info_geo_json": "Customizations.Data.getInfoGeoJson", - "azure.planetarycomputer.operations.DataOperations.get_item_asset_details": "Customizations.Data.getItemAssetDetails", - "azure.planetarycomputer.aio.operations.DataOperations.get_item_asset_details": "Customizations.Data.getItemAssetDetails", - "azure.planetarycomputer.operations.DataOperations.get_part": "Customizations.Data.getPart", - "azure.planetarycomputer.aio.operations.DataOperations.get_part": "Customizations.Data.getPart", - "azure.planetarycomputer.operations.DataOperations.get_part_with_dimensions": "Customizations.Data.getPartWithDimensions", - "azure.planetarycomputer.aio.operations.DataOperations.get_part_with_dimensions": "Customizations.Data.getPartWithDimensions", - "azure.planetarycomputer.operations.DataOperations.get_point": "Customizations.Data.getPoint", - "azure.planetarycomputer.aio.operations.DataOperations.get_point": "Customizations.Data.getPoint", - "azure.planetarycomputer.operations.DataOperations.get_preview": "Customizations.Data.getPreview", - "azure.planetarycomputer.aio.operations.DataOperations.get_preview": "Customizations.Data.getPreview", - "azure.planetarycomputer.operations.DataOperations.get_preview_with_format": "Customizations.Data.getPreviewWithFormat", - "azure.planetarycomputer.aio.operations.DataOperations.get_preview_with_format": "Customizations.Data.getPreviewWithFormat", - "azure.planetarycomputer.operations.DataOperations.create_static_image": "Customizations.Data.createStaticImage", - "azure.planetarycomputer.aio.operations.DataOperations.create_static_image": "Customizations.Data.createStaticImage", - "azure.planetarycomputer.operations.DataOperations.get_static_image": "Customizations.Data.getStaticImage", - "azure.planetarycomputer.aio.operations.DataOperations.get_static_image": "Customizations.Data.getStaticImage", - "azure.planetarycomputer.operations.DataOperations.list_statistics": "Customizations.Data.listStatistics", - "azure.planetarycomputer.aio.operations.DataOperations.list_statistics": "Customizations.Data.listStatistics", - "azure.planetarycomputer.operations.DataOperations.get_tile_json": "Customizations.Data.getTileJson", - "azure.planetarycomputer.aio.operations.DataOperations.get_tile_json": "Customizations.Data.getTileJson", - "azure.planetarycomputer.operations.DataOperations.get_tile": "Customizations.Data.getTile", - "azure.planetarycomputer.aio.operations.DataOperations.get_tile": "Customizations.Data.getTile", - "azure.planetarycomputer.operations.DataOperations.get_wmts_capabilities": "Customizations.Data.getWmtsCapabilities", - "azure.planetarycomputer.aio.operations.DataOperations.get_wmts_capabilities": "Customizations.Data.getWmtsCapabilities", "azure.planetarycomputer.operations.DataOperations.get_class_map_legend": "Customizations.Data.getClassMapLegend", "azure.planetarycomputer.aio.operations.DataOperations.get_class_map_legend": "Customizations.Data.getClassMapLegend", "azure.planetarycomputer.operations.DataOperations.get_interval_legend": "Customizations.Data.getIntervalLegend", "azure.planetarycomputer.aio.operations.DataOperations.get_interval_legend": "Customizations.Data.getIntervalLegend", "azure.planetarycomputer.operations.DataOperations.get_legend": "Customizations.Data.getLegend", "azure.planetarycomputer.aio.operations.DataOperations.get_legend": "Customizations.Data.getLegend", - "azure.planetarycomputer.operations.DataOperations.get_mosaics_assets_for_point": "Customizations.Data.getMosaicsAssetsForPoint", - "azure.planetarycomputer.aio.operations.DataOperations.get_mosaics_assets_for_point": "Customizations.Data.getMosaicsAssetsForPoint", - "azure.planetarycomputer.operations.DataOperations.get_mosaics_assets_for_tile": "Customizations.Data.getMosaicsAssetsForTile", - "azure.planetarycomputer.aio.operations.DataOperations.get_mosaics_assets_for_tile": "Customizations.Data.getMosaicsAssetsForTile", - "azure.planetarycomputer.operations.DataOperations.get_mosaics_search_info": "Customizations.Data.getMosaicsSearchInfo", - "azure.planetarycomputer.aio.operations.DataOperations.get_mosaics_search_info": "Customizations.Data.getMosaicsSearchInfo", "azure.planetarycomputer.operations.DataOperations.register_mosaics_search": "Customizations.Data.registerMosaicsSearch", "azure.planetarycomputer.aio.operations.DataOperations.register_mosaics_search": "Customizations.Data.registerMosaicsSearch", - "azure.planetarycomputer.operations.DataOperations.get_mosaics_tile_json": "Customizations.Data.getMosaicsTileJson", - "azure.planetarycomputer.aio.operations.DataOperations.get_mosaics_tile_json": "Customizations.Data.getMosaicsTileJson", - "azure.planetarycomputer.operations.DataOperations.get_mosaics_tile": "Customizations.Data.getMosaicsTile", - "azure.planetarycomputer.aio.operations.DataOperations.get_mosaics_tile": "Customizations.Data.getMosaicsTile", - "azure.planetarycomputer.operations.DataOperations.get_mosaics_wmts_capabilities": "Customizations.Data.getMosaicsWmtsCapabilities", - "azure.planetarycomputer.aio.operations.DataOperations.get_mosaics_wmts_capabilities": "Customizations.Data.getMosaicsWmtsCapabilities", - "azure.planetarycomputer.operations.SharedAccessSignatureOperations.get_sign": "Customizations.SharedAccessSignature.getSign", - "azure.planetarycomputer.aio.operations.SharedAccessSignatureOperations.get_sign": "Customizations.SharedAccessSignature.getSign", - "azure.planetarycomputer.operations.SharedAccessSignatureOperations.get_token": "Customizations.SharedAccessSignature.getToken", - "azure.planetarycomputer.aio.operations.SharedAccessSignatureOperations.get_token": "Customizations.SharedAccessSignature.getToken", - "azure.planetarycomputer.operations.SharedAccessSignatureOperations.revoke_token": "Customizations.SharedAccessSignature.revokeToken", - "azure.planetarycomputer.aio.operations.SharedAccessSignatureOperations.revoke_token": "Customizations.SharedAccessSignature.revokeToken" + "azure.planetarycomputer.operations.DataOperations.list_tilesets": "Customizations.Data.listTilesets", + "azure.planetarycomputer.aio.operations.DataOperations.list_tilesets": "Customizations.Data.listTilesets", + "azure.planetarycomputer.operations.DataOperations.get_tileset_metadata": "Customizations.Data.getTilesetMetadata", + "azure.planetarycomputer.aio.operations.DataOperations.get_tileset_metadata": "Customizations.Data.getTilesetMetadata", + "azure.planetarycomputer.operations.DataOperations.get_tile": "Customizations.Data.getTile", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile": "Customizations.Data.getTile", + "azure.planetarycomputer.operations.DataOperations.get_tile_by_format": "Customizations.Data.getTileByFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_by_format": "Customizations.Data.getTileByFormat", + "azure.planetarycomputer.operations.DataOperations.get_tile_by_scale": "Customizations.Data.getTileByScale", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_by_scale": "Customizations.Data.getTileByScale", + "azure.planetarycomputer.operations.DataOperations.get_tile_by_scale_and_format": "Customizations.Data.getTileByScaleAndFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_by_scale_and_format": "Customizations.Data.getTileByScaleAndFormat", + "azure.planetarycomputer.operations.DataOperations.get_tile_no_tms": "Customizations.Data.getTileNoTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_no_tms": "Customizations.Data.getTileNoTms", + "azure.planetarycomputer.operations.DataOperations.get_tile_no_tms_by_format": "Customizations.Data.getTileNoTmsByFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_no_tms_by_format": "Customizations.Data.getTileNoTmsByFormat", + "azure.planetarycomputer.operations.DataOperations.get_tile_no_tms_by_scale": "Customizations.Data.getTileNoTmsByScale", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_no_tms_by_scale": "Customizations.Data.getTileNoTmsByScale", + "azure.planetarycomputer.operations.DataOperations.get_tile_no_tms_by_scale_and_format": "Customizations.Data.getTileNoTmsByScaleAndFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_tile_no_tms_by_scale_and_format": "Customizations.Data.getTileNoTmsByScaleAndFormat", + "azure.planetarycomputer.operations.DataOperations.crop_feature_geo_json": "Customizations.Data.cropFeatureGeoJson", + "azure.planetarycomputer.aio.operations.DataOperations.crop_feature_geo_json": "Customizations.Data.cropFeatureGeoJson", + "azure.planetarycomputer.operations.DataOperations.crop_feature_geo_json_format": "Customizations.Data.cropFeatureGeoJsonFormat", + "azure.planetarycomputer.aio.operations.DataOperations.crop_feature_geo_json_format": "Customizations.Data.cropFeatureGeoJsonFormat", + "azure.planetarycomputer.operations.DataOperations.crop_feature_geo_json_width_by_height": "Customizations.Data.cropFeatureGeoJsonWidthByHeight", + "azure.planetarycomputer.aio.operations.DataOperations.crop_feature_geo_json_width_by_height": "Customizations.Data.cropFeatureGeoJsonWidthByHeight", + "azure.planetarycomputer.operations.DataOperations.get_item_bounds": "Customizations.Data.getItemBounds", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_bounds": "Customizations.Data.getItemBounds", + "azure.planetarycomputer.operations.DataOperations.get_item_info": "Customizations.Data.getItemInfo", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_info": "Customizations.Data.getItemInfo", + "azure.planetarycomputer.operations.DataOperations.get_item_info_geo_json": "Customizations.Data.getItemInfoGeoJson", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_info_geo_json": "Customizations.Data.getItemInfoGeoJson", + "azure.planetarycomputer.operations.DataOperations.list_item_available_assets": "Customizations.Data.listItemAvailableAssets", + "azure.planetarycomputer.aio.operations.DataOperations.list_item_available_assets": "Customizations.Data.listItemAvailableAssets", + "azure.planetarycomputer.operations.DataOperations.get_item_asset_statistics": "Customizations.Data.getItemAssetStatistics", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_asset_statistics": "Customizations.Data.getItemAssetStatistics", + "azure.planetarycomputer.operations.DataOperations.list_item_statistics": "Customizations.Data.listItemStatistics", + "azure.planetarycomputer.aio.operations.DataOperations.list_item_statistics": "Customizations.Data.listItemStatistics", + "azure.planetarycomputer.operations.DataOperations.get_item_geo_json_statistics": "Customizations.Data.getItemGeoJsonStatistics", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_geo_json_statistics": "Customizations.Data.getItemGeoJsonStatistics", + "azure.planetarycomputer.operations.DataOperations.get_item_tile_json": "Customizations.Data.getItemTileJson", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_tile_json": "Customizations.Data.getItemTileJson", + "azure.planetarycomputer.operations.DataOperations.get_item_tile_json_tms": "Customizations.Data.getItemTileJsonTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_tile_json_tms": "Customizations.Data.getItemTileJsonTms", + "azure.planetarycomputer.operations.DataOperations.get_item_wmts_capabilities": "Customizations.Data.getItemWmtsCapabilities", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_wmts_capabilities": "Customizations.Data.getItemWmtsCapabilities", + "azure.planetarycomputer.operations.DataOperations.get_item_wmts_capabilities_tms": "Customizations.Data.getItemWmtsCapabilitiesTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_wmts_capabilities_tms": "Customizations.Data.getItemWmtsCapabilitiesTms", + "azure.planetarycomputer.operations.DataOperations.get_item_point": "Customizations.Data.getItemPoint", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_point": "Customizations.Data.getItemPoint", + "azure.planetarycomputer.operations.DataOperations.get_item_preview": "Customizations.Data.getItemPreview", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_preview": "Customizations.Data.getItemPreview", + "azure.planetarycomputer.operations.DataOperations.get_item_preview_with_format": "Customizations.Data.getItemPreviewWithFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_preview_with_format": "Customizations.Data.getItemPreviewWithFormat", + "azure.planetarycomputer.operations.DataOperations.get_item_bbox_crop": "Customizations.Data.getItemBboxCrop", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_bbox_crop": "Customizations.Data.getItemBboxCrop", + "azure.planetarycomputer.operations.DataOperations.get_item_bbox_crop_with_dimensions": "Customizations.Data.getItemBboxCropWithDimensions", + "azure.planetarycomputer.aio.operations.DataOperations.get_item_bbox_crop_with_dimensions": "Customizations.Data.getItemBboxCropWithDimensions", + "azure.planetarycomputer.operations.DataOperations.list_collection_tilesets": "Customizations.Data.listCollectionTilesets", + "azure.planetarycomputer.aio.operations.DataOperations.list_collection_tilesets": "Customizations.Data.listCollectionTilesets", + "azure.planetarycomputer.operations.DataOperations.get_collection_tileset_metadata": "Customizations.Data.getCollectionTilesetMetadata", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tileset_metadata": "Customizations.Data.getCollectionTilesetMetadata", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_by_scale_and_format": "Customizations.Data.getCollectionTileByScaleAndFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_by_scale_and_format": "Customizations.Data.getCollectionTileByScaleAndFormat", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile": "Customizations.Data.getCollectionTile", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile": "Customizations.Data.getCollectionTile", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_by_format": "Customizations.Data.getCollectionTileByFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_by_format": "Customizations.Data.getCollectionTileByFormat", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_by_scale": "Customizations.Data.getCollectionTileByScale", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_by_scale": "Customizations.Data.getCollectionTileByScale", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_no_tms_by_scale_and_format": "Customizations.Data.getCollectionTileNoTmsByScaleAndFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_no_tms_by_scale_and_format": "Customizations.Data.getCollectionTileNoTmsByScaleAndFormat", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_no_tms": "Customizations.Data.getCollectionTileNoTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_no_tms": "Customizations.Data.getCollectionTileNoTms", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_no_tms_by_format": "Customizations.Data.getCollectionTileNoTmsByFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_no_tms_by_format": "Customizations.Data.getCollectionTileNoTmsByFormat", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_no_tms_by_scale": "Customizations.Data.getCollectionTileNoTmsByScale", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_no_tms_by_scale": "Customizations.Data.getCollectionTileNoTmsByScale", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_json": "Customizations.Data.getCollectionTileJson", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_json": "Customizations.Data.getCollectionTileJson", + "azure.planetarycomputer.operations.DataOperations.get_collection_tile_json_tms": "Customizations.Data.getCollectionTileJsonTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_tile_json_tms": "Customizations.Data.getCollectionTileJsonTms", + "azure.planetarycomputer.operations.DataOperations.get_collection_wmts_capabilities": "Customizations.Data.getCollectionWmtsCapabilities", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_wmts_capabilities": "Customizations.Data.getCollectionWmtsCapabilities", + "azure.planetarycomputer.operations.DataOperations.get_collection_wmts_capabilities_tms": "Customizations.Data.getCollectionWmtsCapabilitiesTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_wmts_capabilities_tms": "Customizations.Data.getCollectionWmtsCapabilitiesTms", + "azure.planetarycomputer.operations.DataOperations.get_collection_assets_for_tile": "Customizations.Data.getCollectionAssetsForTile", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_assets_for_tile": "Customizations.Data.getCollectionAssetsForTile", + "azure.planetarycomputer.operations.DataOperations.get_collection_assets_for_tile_no_tms": "Customizations.Data.getCollectionAssetsForTileNoTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_assets_for_tile_no_tms": "Customizations.Data.getCollectionAssetsForTileNoTms", + "azure.planetarycomputer.operations.DataOperations.get_collection_assets_for_bbox": "Customizations.Data.getCollectionAssetsForBbox", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_assets_for_bbox": "Customizations.Data.getCollectionAssetsForBbox", + "azure.planetarycomputer.operations.DataOperations.get_collection_info": "Customizations.Data.getCollectionInfo", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_info": "Customizations.Data.getCollectionInfo", + "azure.planetarycomputer.operations.DataOperations.get_collection_bbox_crop": "Customizations.Data.getCollectionBboxCrop", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_bbox_crop": "Customizations.Data.getCollectionBboxCrop", + "azure.planetarycomputer.operations.DataOperations.get_collection_bbox_crop_with_dimensions": "Customizations.Data.getCollectionBboxCropWithDimensions", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_bbox_crop_with_dimensions": "Customizations.Data.getCollectionBboxCropWithDimensions", + "azure.planetarycomputer.operations.DataOperations.crop_collection_feature_geo_json": "Customizations.Data.cropCollectionFeatureGeoJson", + "azure.planetarycomputer.aio.operations.DataOperations.crop_collection_feature_geo_json": "Customizations.Data.cropCollectionFeatureGeoJson", + "azure.planetarycomputer.operations.DataOperations.crop_collection_feature_geo_json_format": "Customizations.Data.cropCollectionFeatureGeoJsonFormat", + "azure.planetarycomputer.aio.operations.DataOperations.crop_collection_feature_geo_json_format": "Customizations.Data.cropCollectionFeatureGeoJsonFormat", + "azure.planetarycomputer.operations.DataOperations.crop_collection_feature_geo_json_width_by_height": "Customizations.Data.cropCollectionFeatureGeoJsonWidthByHeight", + "azure.planetarycomputer.aio.operations.DataOperations.crop_collection_feature_geo_json_width_by_height": "Customizations.Data.cropCollectionFeatureGeoJsonWidthByHeight", + "azure.planetarycomputer.operations.DataOperations.get_collection_point": "Customizations.Data.getCollectionPoint", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_point": "Customizations.Data.getCollectionPoint", + "azure.planetarycomputer.operations.DataOperations.get_collection_point_assets": "Customizations.Data.getCollectionPointAssets", + "azure.planetarycomputer.aio.operations.DataOperations.get_collection_point_assets": "Customizations.Data.getCollectionPointAssets", + "azure.planetarycomputer.operations.DataOperations.list_searches_tilesets": "Customizations.Data.listSearchesTilesets", + "azure.planetarycomputer.aio.operations.DataOperations.list_searches_tilesets": "Customizations.Data.listSearchesTilesets", + "azure.planetarycomputer.operations.DataOperations.get_searches_tileset_metadata": "Customizations.Data.getSearchesTilesetMetadata", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tileset_metadata": "Customizations.Data.getSearchesTilesetMetadata", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_by_scale_and_format": "Customizations.Data.getSearchesTileByScaleAndFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_by_scale_and_format": "Customizations.Data.getSearchesTileByScaleAndFormat", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile": "Customizations.Data.getSearchesTile", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile": "Customizations.Data.getSearchesTile", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_by_format": "Customizations.Data.getSearchesTileByFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_by_format": "Customizations.Data.getSearchesTileByFormat", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_by_scale": "Customizations.Data.getSearchesTileByScale", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_by_scale": "Customizations.Data.getSearchesTileByScale", + "azure.planetarycomputer.operations.DataOperations.get_searches_assets_for_tile": "Customizations.Data.getSearchesAssetsForTile", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_assets_for_tile": "Customizations.Data.getSearchesAssetsForTile", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_json_tms": "Customizations.Data.getSearchesTileJsonTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_json_tms": "Customizations.Data.getSearchesTileJsonTms", + "azure.planetarycomputer.operations.DataOperations.get_searches_wmts_capabilities_tms": "Customizations.Data.getSearchesWmtsCapabilitiesTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_wmts_capabilities_tms": "Customizations.Data.getSearchesWmtsCapabilitiesTms", + "azure.planetarycomputer.operations.DataOperations.get_searches_info": "Customizations.Data.getSearchesInfo", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_info": "Customizations.Data.getSearchesInfo", + "azure.planetarycomputer.operations.DataOperations.get_searches_bbox_crop": "Customizations.Data.getSearchesBboxCrop", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_bbox_crop": "Customizations.Data.getSearchesBboxCrop", + "azure.planetarycomputer.operations.DataOperations.get_searches_bbox_crop_with_dimensions": "Customizations.Data.getSearchesBboxCropWithDimensions", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_bbox_crop_with_dimensions": "Customizations.Data.getSearchesBboxCropWithDimensions", + "azure.planetarycomputer.operations.DataOperations.get_searches_bbox_assets": "Customizations.Data.getSearchesBboxAssets", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_bbox_assets": "Customizations.Data.getSearchesBboxAssets", + "azure.planetarycomputer.operations.DataOperations.crop_searches_feature_geo_json": "Customizations.Data.cropSearchesFeatureGeoJson", + "azure.planetarycomputer.aio.operations.DataOperations.crop_searches_feature_geo_json": "Customizations.Data.cropSearchesFeatureGeoJson", + "azure.planetarycomputer.operations.DataOperations.crop_searches_feature_geo_json_format": "Customizations.Data.cropSearchesFeatureGeoJsonFormat", + "azure.planetarycomputer.aio.operations.DataOperations.crop_searches_feature_geo_json_format": "Customizations.Data.cropSearchesFeatureGeoJsonFormat", + "azure.planetarycomputer.operations.DataOperations.crop_searches_feature_geo_json_width_by_height": "Customizations.Data.cropSearchesFeatureGeoJsonWidthByHeight", + "azure.planetarycomputer.aio.operations.DataOperations.crop_searches_feature_geo_json_width_by_height": "Customizations.Data.cropSearchesFeatureGeoJsonWidthByHeight", + "azure.planetarycomputer.operations.DataOperations.get_searches_wmts_capabilities": "Customizations.Data.getSearchesWmtsCapabilities", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_wmts_capabilities": "Customizations.Data.getSearchesWmtsCapabilities", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_json": "Customizations.Data.getSearchesTileJson", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_json": "Customizations.Data.getSearchesTileJson", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_no_tms": "Customizations.Data.getSearchesTileNoTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_no_tms": "Customizations.Data.getSearchesTileNoTms", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_no_tms_by_format": "Customizations.Data.getSearchesTileNoTmsByFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_no_tms_by_format": "Customizations.Data.getSearchesTileNoTmsByFormat", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_no_tms_by_scale": "Customizations.Data.getSearchesTileNoTmsByScale", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_no_tms_by_scale": "Customizations.Data.getSearchesTileNoTmsByScale", + "azure.planetarycomputer.operations.DataOperations.get_searches_tile_no_tms_by_scale_and_format": "Customizations.Data.getSearchesTileNoTmsByScaleAndFormat", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_tile_no_tms_by_scale_and_format": "Customizations.Data.getSearchesTileNoTmsByScaleAndFormat", + "azure.planetarycomputer.operations.DataOperations.get_searches_assets_for_tile_no_tms": "Customizations.Data.getSearchesAssetsForTileNoTms", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_assets_for_tile_no_tms": "Customizations.Data.getSearchesAssetsForTileNoTms", + "azure.planetarycomputer.operations.DataOperations.get_searches_point": "Customizations.Data.getSearchesPoint", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_point": "Customizations.Data.getSearchesPoint", + "azure.planetarycomputer.operations.DataOperations.get_searches_point_with_assets": "Customizations.Data.getSearchesPointWithAssets", + "azure.planetarycomputer.aio.operations.DataOperations.get_searches_point_with_assets": "Customizations.Data.getSearchesPointWithAssets", + "azure.planetarycomputer.operations.SasOperations.get_sign": "Customizations.SharedAccessSignature.getSign", + "azure.planetarycomputer.aio.operations.SasOperations.get_sign": "Customizations.SharedAccessSignature.getSign", + "azure.planetarycomputer.operations.SasOperations.get_token": "Customizations.SharedAccessSignature.getToken", + "azure.planetarycomputer.aio.operations.SasOperations.get_token": "Customizations.SharedAccessSignature.getToken", + "azure.planetarycomputer.operations.SasOperations.revoke_token": "Customizations.SharedAccessSignature.revokeToken", + "azure.planetarycomputer.aio.operations.SasOperations.revoke_token": "Customizations.SharedAccessSignature.revokeToken" } } \ No newline at end of file diff --git a/sdk/planetarycomputer/azure-planetarycomputer/assets.json b/sdk/planetarycomputer/azure-planetarycomputer/assets.json index c5a61b1df3c7..d8936b3a51c3 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/planetarycomputer/azure-planetarycomputer", - "Tag": "python/planetarycomputer/azure-planetarycomputer_5c0901687d" + "Tag": "python/planetarycomputer/azure-planetarycomputer_8e27bf2b7c" } diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_client.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_client.py index 40eb821cb51d..94d2495cdf15 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_client.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_client.py @@ -16,7 +16,7 @@ from ._configuration import PlanetaryComputerProClientConfiguration from ._utils.serialization import Deserializer, Serializer -from .operations import DataOperations, IngestionOperations, SharedAccessSignatureOperations, StacOperations +from .operations import DataOperations, IngestionOperations, SasOperations, StacOperations if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -31,16 +31,17 @@ class PlanetaryComputerProClient: :vartype stac: azure.planetarycomputer.operations.StacOperations :ivar data: DataOperations operations :vartype data: azure.planetarycomputer.operations.DataOperations - :ivar shared_access_signature: SharedAccessSignatureOperations operations - :vartype shared_access_signature: - azure.planetarycomputer.operations.SharedAccessSignatureOperations - :param endpoint: Service host. Required. + :ivar sas: SasOperations operations + :vartype sas: azure.planetarycomputer.operations.SasOperations + :param endpoint: GeoCatalog endpoint, e.g. + `https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com + `_. Required. :type endpoint: str :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Known values are - "2025-04-30-preview" and None. Default value is "2025-04-30-preview". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-15". + Default value is "2026-04-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -75,9 +76,7 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) self.ingestion = IngestionOperations(self._client, self._config, self._serialize, self._deserialize) self.stac = StacOperations(self._client, self._config, self._serialize, self._deserialize) self.data = DataOperations(self._client, self._config, self._serialize, self._deserialize) - self.shared_access_signature = SharedAccessSignatureOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.sas = SasOperations(self._client, self._config, self._serialize, self._deserialize) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_configuration.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_configuration.py index c20ae5505446..936350423d07 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_configuration.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_configuration.py @@ -22,18 +22,20 @@ class PlanetaryComputerProClientConfiguration: # pylint: disable=too-many-insta Note that all parameters used to create this instance are saved as instance attributes. - :param endpoint: Service host. Required. + :param endpoint: GeoCatalog endpoint, e.g. + `https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com + `_. Required. :type endpoint: str :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Known values are - "2025-04-30-preview" and None. Default value is "2025-04-30-preview". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-15". + Default value is "2026-04-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-04-30-preview") + api_version: str = kwargs.pop("api_version", "2026-04-15") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py index 4d0183227b6d..a75a22adbb97 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py @@ -22,7 +22,7 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET -from collections.abc import MutableMapping # pylint: disable=import-error +from collections.abc import MutableMapping from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError @@ -515,6 +515,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -628,6 +630,9 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if len(items) > 0: existed_attr_keys.append(xml_name) dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = [] continue # text element is primitive type @@ -694,7 +699,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: } cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -903,6 +908,8 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore @@ -995,16 +1002,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -1078,6 +1089,7 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_validation.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_version.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_version.py index be71c81bd282..0ec13ea52bbf 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_version.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_client.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_client.py index 18f8deda42a5..5b4f909e1c47 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_client.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_client.py @@ -16,7 +16,7 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import PlanetaryComputerProClientConfiguration -from .operations import DataOperations, IngestionOperations, SharedAccessSignatureOperations, StacOperations +from .operations import DataOperations, IngestionOperations, SasOperations, StacOperations if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -31,16 +31,17 @@ class PlanetaryComputerProClient: :vartype stac: azure.planetarycomputer.aio.operations.StacOperations :ivar data: DataOperations operations :vartype data: azure.planetarycomputer.aio.operations.DataOperations - :ivar shared_access_signature: SharedAccessSignatureOperations operations - :vartype shared_access_signature: - azure.planetarycomputer.aio.operations.SharedAccessSignatureOperations - :param endpoint: Service host. Required. + :ivar sas: SasOperations operations + :vartype sas: azure.planetarycomputer.aio.operations.SasOperations + :param endpoint: GeoCatalog endpoint, e.g. + `https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com + `_. Required. :type endpoint: str :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Known values are - "2025-04-30-preview" and None. Default value is "2025-04-30-preview". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-15". + Default value is "2026-04-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -75,9 +76,7 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: self.ingestion = IngestionOperations(self._client, self._config, self._serialize, self._deserialize) self.stac = StacOperations(self._client, self._config, self._serialize, self._deserialize) self.data = DataOperations(self._client, self._config, self._serialize, self._deserialize) - self.shared_access_signature = SharedAccessSignatureOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.sas = SasOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_configuration.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_configuration.py index a72ad88a8cf1..f6474e52d2e2 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_configuration.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/_configuration.py @@ -22,18 +22,20 @@ class PlanetaryComputerProClientConfiguration: # pylint: disable=too-many-insta Note that all parameters used to create this instance are saved as instance attributes. - :param endpoint: Service host. Required. + :param endpoint: GeoCatalog endpoint, e.g. + `https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com + `_. Required. :type endpoint: str :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Known values are - "2025-04-30-preview" and None. Default value is "2025-04-30-preview". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-15". + Default value is "2026-04-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-04-30-preview") + api_version: str = kwargs.pop("api_version", "2026-04-15") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/__init__.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/__init__.py index 8ebab4777f3c..77959284ac2c 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/__init__.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/__init__.py @@ -15,7 +15,7 @@ from ._operations import IngestionOperations # type: ignore from ._operations import StacOperations # type: ignore from ._operations import DataOperations # type: ignore -from ._operations import SharedAccessSignatureOperations # type: ignore +from ._operations import SasOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -25,7 +25,7 @@ "IngestionOperations", "StacOperations", "DataOperations", - "SharedAccessSignatureOperations", + "SasOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py index 54bc3f1903ec..d87e6b15830a 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from collections.abc import MutableMapping # pylint: disable=import-error +from collections.abc import MutableMapping from io import IOBase import json from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload @@ -33,40 +33,94 @@ from azure.core.utils import case_insensitive_dict from ... import models as _models -from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _deserialize_xml # pylint: disable=unused-import +from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _deserialize_xml from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import prepare_multipart_form_data from ...operations._operations import ( - build_data_create_static_image_request, - build_data_crop_geo_json_request, - build_data_crop_geo_json_with_dimensions_request, - build_data_get_asset_statistics_request, - build_data_get_bounds_request, + build_data_crop_collection_feature_geo_json_format_request, + build_data_crop_collection_feature_geo_json_request, + build_data_crop_collection_feature_geo_json_width_by_height_request, + build_data_crop_feature_geo_json_format_request, + build_data_crop_feature_geo_json_request, + build_data_crop_feature_geo_json_width_by_height_request, + build_data_crop_searches_feature_geo_json_format_request, + build_data_crop_searches_feature_geo_json_request, + build_data_crop_searches_feature_geo_json_width_by_height_request, build_data_get_class_map_legend_request, - build_data_get_geo_json_statistics_request, - build_data_get_info_geo_json_request, + build_data_get_collection_assets_for_bbox_request, + build_data_get_collection_assets_for_tile_no_tms_request, + build_data_get_collection_assets_for_tile_request, + build_data_get_collection_bbox_crop_request, + build_data_get_collection_bbox_crop_with_dimensions_request, + build_data_get_collection_info_request, + build_data_get_collection_point_assets_request, + build_data_get_collection_point_request, + build_data_get_collection_tile_by_format_request, + build_data_get_collection_tile_by_scale_and_format_request, + build_data_get_collection_tile_by_scale_request, + build_data_get_collection_tile_json_request, + build_data_get_collection_tile_json_tms_request, + build_data_get_collection_tile_no_tms_by_format_request, + build_data_get_collection_tile_no_tms_by_scale_and_format_request, + build_data_get_collection_tile_no_tms_by_scale_request, + build_data_get_collection_tile_no_tms_request, + build_data_get_collection_tile_request, + build_data_get_collection_tileset_metadata_request, + build_data_get_collection_wmts_capabilities_request, + build_data_get_collection_wmts_capabilities_tms_request, build_data_get_interval_legend_request, - build_data_get_item_asset_details_request, + build_data_get_item_asset_statistics_request, + build_data_get_item_bbox_crop_request, + build_data_get_item_bbox_crop_with_dimensions_request, + build_data_get_item_bounds_request, + build_data_get_item_geo_json_statistics_request, + build_data_get_item_info_geo_json_request, + build_data_get_item_info_request, + build_data_get_item_point_request, + build_data_get_item_preview_request, + build_data_get_item_preview_with_format_request, + build_data_get_item_tile_json_request, + build_data_get_item_tile_json_tms_request, + build_data_get_item_wmts_capabilities_request, + build_data_get_item_wmts_capabilities_tms_request, build_data_get_legend_request, - build_data_get_mosaics_assets_for_point_request, - build_data_get_mosaics_assets_for_tile_request, - build_data_get_mosaics_search_info_request, - build_data_get_mosaics_tile_json_request, - build_data_get_mosaics_tile_request, - build_data_get_mosaics_wmts_capabilities_request, - build_data_get_part_request, - build_data_get_part_with_dimensions_request, - build_data_get_point_request, - build_data_get_preview_request, - build_data_get_preview_with_format_request, - build_data_get_static_image_request, - build_data_get_tile_json_request, + build_data_get_searches_assets_for_tile_no_tms_request, + build_data_get_searches_assets_for_tile_request, + build_data_get_searches_bbox_assets_request, + build_data_get_searches_bbox_crop_request, + build_data_get_searches_bbox_crop_with_dimensions_request, + build_data_get_searches_info_request, + build_data_get_searches_point_request, + build_data_get_searches_point_with_assets_request, + build_data_get_searches_tile_by_format_request, + build_data_get_searches_tile_by_scale_and_format_request, + build_data_get_searches_tile_by_scale_request, + build_data_get_searches_tile_json_request, + build_data_get_searches_tile_json_tms_request, + build_data_get_searches_tile_no_tms_by_format_request, + build_data_get_searches_tile_no_tms_by_scale_and_format_request, + build_data_get_searches_tile_no_tms_by_scale_request, + build_data_get_searches_tile_no_tms_request, + build_data_get_searches_tile_request, + build_data_get_searches_tileset_metadata_request, + build_data_get_searches_wmts_capabilities_request, + build_data_get_searches_wmts_capabilities_tms_request, + build_data_get_tile_by_format_request, + build_data_get_tile_by_scale_and_format_request, + build_data_get_tile_by_scale_request, build_data_get_tile_matrix_definitions_request, + build_data_get_tile_no_tms_by_format_request, + build_data_get_tile_no_tms_by_scale_and_format_request, + build_data_get_tile_no_tms_by_scale_request, + build_data_get_tile_no_tms_request, build_data_get_tile_request, - build_data_get_wmts_capabilities_request, - build_data_list_available_assets_request, - build_data_list_statistics_request, + build_data_get_tileset_metadata_request, + build_data_list_collection_tilesets_request, + build_data_list_item_available_assets_request, + build_data_list_item_statistics_request, + build_data_list_searches_tilesets_request, build_data_list_tile_matrices_request, + build_data_list_tilesets_request, build_data_register_mosaics_search_request, build_ingestion_cancel_all_operations_request, build_ingestion_cancel_operation_request, @@ -86,15 +140,13 @@ build_ingestion_list_sources_request, build_ingestion_replace_source_request, build_ingestion_update_request, - build_shared_access_signature_get_sign_request, - build_shared_access_signature_get_token_request, - build_shared_access_signature_revoke_token_request, + build_sas_get_sign_request, + build_sas_get_token_request, + build_sas_revoke_token_request, build_stac_add_mosaic_request, build_stac_create_collection_asset_request, build_stac_create_collection_request, build_stac_create_item_request, - build_stac_create_or_replace_collection_request, - build_stac_create_or_replace_item_request, build_stac_create_queryables_request, build_stac_create_render_option_request, build_stac_delete_collection_asset_request, @@ -120,6 +172,8 @@ build_stac_list_queryables_request, build_stac_list_render_options_request, build_stac_replace_collection_asset_request, + build_stac_replace_collection_request, + build_stac_replace_item_request, build_stac_replace_mosaic_request, build_stac_replace_partition_type_request, build_stac_replace_queryable_request, @@ -206,7 +260,8 @@ async def cancel_operation(self, operation_id: str, **kwargs: Any) -> None: @distributed_trace_async async def cancel_all_operations(self, **kwargs: Any) -> None: - """Cancel all running operations of a geo-catalog collection. + """Cancel all pending and running operations across the entire GeoCatalog instance. This is a + catalog-wide operation and is not scoped to a specific collection. :return: None :rtype: None @@ -283,6 +338,7 @@ async def get_operation(self, operation_id: str, **kwargs: Any) -> _models.Opera } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -300,7 +356,7 @@ async def get_operation(self, operation_id: str, **kwargs: Any) -> _models.Opera raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Operation, response.json()) @@ -390,7 +446,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -449,6 +508,7 @@ async def create_run(self, collection_id: str, ingestion_id: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -469,7 +529,7 @@ async def create_run(self, collection_id: str, ingestion_id: str, **kwargs: Any) response_headers["location"] = self._deserialize("str", response.headers.get("location")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionRun, response.json()) @@ -518,6 +578,7 @@ async def get_run(self, collection_id: str, ingestion_id: str, run_id: str, **kw } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -535,7 +596,7 @@ async def get_run(self, collection_id: str, ingestion_id: str, run_id: str, **kw raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionRun, response.json()) @@ -624,7 +685,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IngestionRun], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.IngestionRun], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -754,6 +818,7 @@ async def create( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -774,7 +839,7 @@ async def create( response_headers["location"] = self._deserialize("str", response.headers.get("location")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionDefinition, response.json()) @@ -809,6 +874,7 @@ async def _delete_initial(self, collection_id: str, ingestion_id: str, **kwargs: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -828,7 +894,7 @@ async def _delete_initial(self, collection_id: str, ingestion_id: str, **kwargs: response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -930,6 +996,7 @@ async def get(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> _mo } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -947,7 +1014,7 @@ async def get(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> _mo raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionDefinition, response.json()) @@ -1028,7 +1095,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IngestionDefinition], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.IngestionDefinition], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1184,6 +1254,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1201,7 +1272,7 @@ async def update( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionDefinition, response.json()) @@ -1304,6 +1375,7 @@ async def create_source( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1324,7 +1396,7 @@ async def create_source( response_headers["location"] = self._deserialize("str", response.headers.get("location")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionSource, response.json()) @@ -1436,6 +1508,7 @@ async def replace_source( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1456,7 +1529,7 @@ async def replace_source( response_headers["location"] = self._deserialize("str", response.headers.get("location")) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionSource, response.json()) @@ -1547,6 +1620,7 @@ async def get_source(self, id: str, **kwargs: Any) -> _models.IngestionSource: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1564,7 +1638,7 @@ async def get_source(self, id: str, **kwargs: Any) -> _models.IngestionSource: raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngestionSource, response.json()) @@ -1642,7 +1716,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IngestionSourceSummary], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.IngestionSourceSummary], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1725,7 +1802,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ManagedIdentityMetadata], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ManagedIdentityMetadata], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1845,6 +1925,7 @@ async def create_collection_asset( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1862,7 +1943,7 @@ async def create_collection_asset( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacCollection, response.json()) @@ -1958,6 +2039,7 @@ async def replace_collection_asset( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1975,7 +2057,7 @@ async def replace_collection_asset( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacCollection, response.json()) @@ -2023,6 +2105,7 @@ async def delete_collection_asset(self, collection_id: str, asset_id: str, **kwa } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2040,7 +2123,7 @@ async def delete_collection_asset(self, collection_id: str, asset_id: str, **kwa raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacCollection, response.json()) @@ -2085,6 +2168,7 @@ async def get_collection_configuration(self, collection_id: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2102,7 +2186,7 @@ async def get_collection_configuration(self, collection_id: str, **kwargs: Any) raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.UserCollectionSettings, response.json()) @@ -2222,6 +2306,7 @@ async def add_mosaic( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2239,7 +2324,7 @@ async def add_mosaic( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacMosaic, response.json()) @@ -2380,6 +2465,7 @@ async def replace_mosaic( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2397,7 +2483,7 @@ async def replace_mosaic( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacMosaic, response.json()) @@ -2498,6 +2584,7 @@ async def get_mosaic(self, collection_id: str, mosaic_id: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2515,7 +2602,7 @@ async def get_mosaic(self, collection_id: str, mosaic_id: str, **kwargs: Any) -> raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacMosaic, response.json()) @@ -2560,6 +2647,7 @@ async def list_mosaics(self, collection_id: str, **kwargs: Any) -> List[_models. } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2577,7 +2665,7 @@ async def list_mosaics(self, collection_id: str, **kwargs: Any) -> List[_models. raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(List[_models.StacMosaic], response.json()) @@ -2622,6 +2710,7 @@ async def _create_collection_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2641,7 +2730,7 @@ async def _create_collection_initial( response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2759,12 +2848,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @overload - async def create_or_replace_collection( + async def replace_collection( self, collection_id: str, body: _models.StacCollection, *, content_type: str = "application/json", **kwargs: Any ) -> _models.StacCollection: - """Create or update Collection. + """Replace Collection. - Create or replace a collection in the GeoCatalog instance. + Replace an existing collection in the GeoCatalog instance. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -2779,12 +2868,12 @@ async def create_or_replace_collection( """ @overload - async def create_or_replace_collection( + async def replace_collection( self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.StacCollection: - """Create or update Collection. + """Replace Collection. - Create or replace a collection in the GeoCatalog instance. + Replace an existing collection in the GeoCatalog instance. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -2799,12 +2888,12 @@ async def create_or_replace_collection( """ @overload - async def create_or_replace_collection( + async def replace_collection( self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.StacCollection: - """Create or update Collection. + """Replace Collection. - Create or replace a collection in the GeoCatalog instance. + Replace an existing collection in the GeoCatalog instance. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -2819,12 +2908,12 @@ async def create_or_replace_collection( """ @distributed_trace_async - async def create_or_replace_collection( + async def replace_collection( self, collection_id: str, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any ) -> _models.StacCollection: - """Create or update Collection. + """Replace Collection. - Create or replace a collection in the GeoCatalog instance. + Replace an existing collection in the GeoCatalog instance. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -2856,7 +2945,7 @@ async def create_or_replace_collection( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_create_or_replace_collection_request( + _request = build_stac_replace_collection_request( collection_id=collection_id, content_type=content_type, api_version=self._config.api_version, @@ -2869,6 +2958,7 @@ async def create_or_replace_collection( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2886,7 +2976,7 @@ async def create_or_replace_collection( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacCollection, response.json()) @@ -2920,6 +3010,7 @@ async def _delete_collection_initial(self, collection_id: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2939,7 +3030,7 @@ async def _delete_collection_initial(self, collection_id: str, **kwargs: Any) -> response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3048,6 +3139,7 @@ async def get_collection( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3065,7 +3157,7 @@ async def get_collection( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacCollection, response.json()) @@ -3120,6 +3212,7 @@ async def get_collections( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3137,7 +3230,7 @@ async def get_collections( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacCatalogCollections, response.json()) @@ -3182,6 +3275,7 @@ async def get_partition_type(self, collection_id: str, **kwargs: Any) -> _models } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3199,7 +3293,7 @@ async def get_partition_type(self, collection_id: str, **kwargs: Any) -> _models raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PartitionType, response.json()) @@ -3471,6 +3565,7 @@ async def create_render_option( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3488,7 +3583,7 @@ async def create_render_option( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RenderOption, response.json()) @@ -3639,6 +3734,7 @@ async def replace_render_option( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3656,7 +3752,7 @@ async def replace_render_option( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RenderOption, response.json()) @@ -3757,6 +3853,7 @@ async def get_render_option(self, collection_id: str, render_option_id: str, **k } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3774,7 +3871,7 @@ async def get_render_option(self, collection_id: str, render_option_id: str, **k raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RenderOption, response.json()) @@ -3819,6 +3916,7 @@ async def list_render_options(self, collection_id: str, **kwargs: Any) -> List[_ } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3836,7 +3934,7 @@ async def list_render_options(self, collection_id: str, **kwargs: Any) -> List[_ raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(List[_models.RenderOption], response.json()) @@ -3881,6 +3979,7 @@ async def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3906,7 +4005,7 @@ async def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> A response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3949,6 +4048,7 @@ async def get_tile_settings(self, collection_id: str, **kwargs: Any) -> _models. } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3966,7 +4066,7 @@ async def get_tile_settings(self, collection_id: str, **kwargs: Any) -> _models. raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.TileSettings, response.json()) @@ -4086,6 +4186,7 @@ async def replace_tile_settings( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4103,7 +4204,7 @@ async def replace_tile_settings( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.TileSettings, response.json()) @@ -4145,6 +4246,7 @@ async def get_conformance_class(self, **kwargs: Any) -> _models.StacConformanceC } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4162,7 +4264,7 @@ async def get_conformance_class(self, **kwargs: Any) -> _models.StacConformanceC raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacConformanceClasses, response.json()) @@ -4204,6 +4306,7 @@ async def get_landing_page(self, **kwargs: Any) -> _models.StacLandingPage: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4221,7 +4324,7 @@ async def get_landing_page(self, **kwargs: Any) -> _models.StacLandingPage: raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacLandingPage, response.json()) @@ -4267,6 +4370,7 @@ async def _create_item_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4286,7 +4390,7 @@ async def _create_item_initial( response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4461,7 +4565,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _create_or_replace_item_initial( + async def _replace_item_initial( self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4485,7 +4589,7 @@ async def _create_or_replace_item_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_create_or_replace_item_request( + _request = build_stac_replace_item_request( collection_id=collection_id, item_id=item_id, content_type=content_type, @@ -4499,6 +4603,7 @@ async def _create_or_replace_item_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4518,7 +4623,7 @@ async def _create_or_replace_item_initial( response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4526,7 +4631,7 @@ async def _create_or_replace_item_initial( return deserialized # type: ignore @overload - async def begin_create_or_replace_item( + async def begin_replace_item( self, collection_id: str, item_id: str, @@ -4535,7 +4640,7 @@ async def begin_create_or_replace_item( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Create or replace a STAC item in a collection. + """Replace a STAC item in a collection. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -4552,10 +4657,10 @@ async def begin_create_or_replace_item( """ @overload - async def begin_create_or_replace_item( + async def begin_replace_item( self, collection_id: str, item_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Create or replace a STAC item in a collection. + """Replace a STAC item in a collection. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -4572,7 +4677,7 @@ async def begin_create_or_replace_item( """ @overload - async def begin_create_or_replace_item( + async def begin_replace_item( self, collection_id: str, item_id: str, @@ -4581,7 +4686,7 @@ async def begin_create_or_replace_item( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Create or replace a STAC item in a collection. + """Replace a STAC item in a collection. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -4598,10 +4703,10 @@ async def begin_create_or_replace_item( """ @distributed_trace_async - async def begin_create_or_replace_item( + async def begin_replace_item( self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: - """Create or replace a STAC item in a collection. + """Replace a STAC item in a collection. :param collection_id: Catalog collection id. Required. :type collection_id: str @@ -4622,7 +4727,7 @@ async def begin_create_or_replace_item( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_replace_item_initial( + raw_result = await self._replace_item_initial( collection_id=collection_id, item_id=item_id, body=body, @@ -4687,6 +4792,7 @@ async def _delete_item_initial(self, collection_id: str, item_id: str, **kwargs: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4706,7 +4812,7 @@ async def _delete_item_initial(self, collection_id: str, item_id: str, **kwargs: response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4771,13 +4877,26 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_item(self, collection_id: str, item_id: str, **kwargs: Any) -> _models.StacItem: + async def get_item( + self, + collection_id: str, + item_id: str, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> _models.StacItem: """Fetch a single STAC Item. :param collection_id: Catalog collection id. Required. :type collection_id: str :param item_id: STAC Item id. Required. :type item_id: str + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int :return: StacItem. The StacItem is compatible with MutableMapping :rtype: ~azure.planetarycomputer.models.StacItem :raises ~azure.core.exceptions.HttpResponseError: @@ -4798,6 +4917,8 @@ async def get_item(self, collection_id: str, item_id: str, **kwargs: Any) -> _mo _request = build_stac_get_item_request( collection_id=collection_id, item_id=item_id, + sign=sign, + duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4807,6 +4928,7 @@ async def get_item(self, collection_id: str, item_id: str, **kwargs: Any) -> _mo } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4824,7 +4946,7 @@ async def get_item(self, collection_id: str, item_id: str, **kwargs: Any) -> _mo raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacItem, response.json()) @@ -4841,6 +4963,9 @@ async def get_item_collection( limit: Optional[int] = None, bounding_box: Optional[List[str]] = None, datetime: Optional[str] = None, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + token: Optional[str] = None, **kwargs: Any ) -> _models.StacItemCollection: """Fetch features of the feature collection with id ``collectionId``. @@ -4911,6 +5036,13 @@ async def get_item_collection( server whether only a single temporal property is used to determine the extent or all relevant temporal properties. Default value is None. :paramtype datetime: str + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :keyword token: Pagination token for fetching the next set of results. Default value is None. + :paramtype token: str :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping :rtype: ~azure.planetarycomputer.models.StacItemCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -4933,6 +5065,9 @@ async def get_item_collection( limit=limit, bounding_box=bounding_box, datetime=datetime, + sign=sign, + duration_in_minutes=duration_in_minutes, + token=token, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4942,6 +5077,7 @@ async def get_item_collection( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4959,7 +5095,7 @@ async def get_item_collection( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacItemCollection, response.json()) @@ -5006,6 +5142,7 @@ async def _update_item_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5025,7 +5162,7 @@ async def _update_item_initial( response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5290,6 +5427,7 @@ async def create_queryables( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5307,7 +5445,7 @@ async def create_queryables( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(List[_models.StacQueryable], response.json()) @@ -5458,6 +5596,7 @@ async def replace_queryable( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5475,7 +5614,7 @@ async def replace_queryable( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacQueryable, response.json()) @@ -5571,6 +5710,7 @@ async def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsRe } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5588,7 +5728,7 @@ async def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsRe raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.QueryableDefinitionsResponse, response.json()) @@ -5636,6 +5776,7 @@ async def get_collection_queryables( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5653,7 +5794,7 @@ async def get_collection_queryables( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.QueryableDefinitionsResponse, response.json()) @@ -5809,6 +5950,7 @@ async def search( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5826,7 +5968,7 @@ async def search( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.StacItemCollection, response.json()) @@ -5891,6 +6033,7 @@ async def get_tile_matrix_definitions(self, tile_matrix_set_id: str, **kwargs: A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5908,7 +6051,7 @@ async def get_tile_matrix_definitions(self, tile_matrix_set_id: str, **kwargs: A raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.TileMatrixSet, response.json()) @@ -5950,6 +6093,7 @@ async def list_tile_matrices(self, **kwargs: Any) -> List[str]: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -5967,7 +6111,7 @@ async def list_tile_matrices(self, **kwargs: Any) -> List[str]: raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(List[str], response.json()) @@ -5977,86 +6121,21 @@ async def list_tile_matrices(self, **kwargs: Any) -> List[str]: return deserialized # type: ignore @distributed_trace_async - async def get_asset_statistics( # pylint: disable=too-many-locals - self, - collection_id: str, - item_id: str, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - **kwargs: Any - ) -> _models.AssetStatisticsResponse: - """Asset Statistics. - - Per Asset statistics. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). + async def get_class_map_legend( + self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any + ) -> _models.ClassMapLegendResponse: + """Get ClassMap Legend. - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. + Generate values and color swatches mapping for a given classmap. - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :return: AssetStatisticsResponse. The AssetStatisticsResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.AssetStatisticsResponse + :param classmap_name: classmap name. Required. + :type classmap_name: str + :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. + :paramtype trim_start: int + :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. + :paramtype trim_end: int + :return: ClassMapLegendResponse. The ClassMapLegendResponse is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.ClassMapLegendResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6070,24 +6149,12 @@ async def get_asset_statistics( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AssetStatisticsResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.ClassMapLegendResponse] = kwargs.pop("cls", None) - _request = build_data_get_asset_statistics_request( - collection_id=collection_id, - item_id=item_id, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - resampling=resampling, - max_size=max_size, - categorical=categorical, - categories_pixels=categories_pixels, - percentiles=percentiles, - histogram_bins=histogram_bins, - histogram_range=histogram_range, + _request = build_data_get_class_map_legend_request( + classmap_name=classmap_name, + trim_start=trim_start, + trim_end=trim_end, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6097,6 +6164,7 @@ async def get_asset_statistics( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6114,9 +6182,9 @@ async def get_asset_statistics( # pylint: disable=too-many-locals raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AssetStatisticsResponse, response.json()) + deserialized = _deserialize(_models.ClassMapLegendResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6124,17 +6192,48 @@ async def get_asset_statistics( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace_async - async def list_available_assets(self, collection_id: str, item_id: str, **kwargs: Any) -> List[str]: - """Available Assets. + async def get_interval_legend( + self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any + ) -> List[List[List[int]]]: + """Get Interval Legend. - Return a list of supported assets. + Generate values and color swatches mapping for a given interval classmap. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :return: list of str - :rtype: list[str] + Returns a color map for intervals, where each interval is defined by: + + * A numeric range `[min, max]` representing the interval boundaries. + * An RGBA color `[red, green, blue, alpha]` associated with the interval. + + The response is a 2D array of interval definitions, where each element is a pair: + + * The first element is an array of two numbers `[min, max]` defining the interval. + * The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA + color. + + Example: + + .. code-block:: json + + [ + [ + [-2, 0], [0, 0, 0, 0] + ], + [ + [1, 32], [255, 255, 178, 255] + ] + ]This example defines two intervals: + + * The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black). + * The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow). + + :param classmap_name: classmap name. Required. + :type classmap_name: str + :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. + :paramtype trim_start: int + :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. + :paramtype trim_end: int + :return: list of list of list of int + :rtype: list[list[list[int]]] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6148,11 +6247,12 @@ async def list_available_assets(self, collection_id: str, item_id: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[str]] = kwargs.pop("cls", None) + cls: ClsType[List[List[List[int]]]] = kwargs.pop("cls", None) - _request = build_data_list_available_assets_request( - collection_id=collection_id, - item_id=item_id, + _request = build_data_get_interval_legend_request( + classmap_name=classmap_name, + trim_start=trim_start, + trim_end=trim_end, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6162,6 +6262,7 @@ async def list_available_assets(self, collection_id: str, item_id: str, **kwargs } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6178,28 +6279,50 @@ async def list_available_assets(self, collection_id: str, item_id: str, **kwargs map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(List[str], response.json()) + deserialized = _deserialize(List[List[List[int]]], response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _models.StacItemBounds: - """Bounds. + async def get_legend( + self, + color_map_name: str, + *, + height: Optional[float] = None, + width: Optional[float] = None, + trim_start: Optional[int] = None, + trim_end: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Get Legend. - Return all Bounds. + Generate a legend image for a given colormap. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :return: StacItemBounds. The StacItemBounds is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemBounds + If the colormap has non-contiguous values at the beginning or end, + which aren't desired in the output image, they can be trimmed by specifying + the number of values to trim. + + :param color_map_name: The name of the registered colormap to generate a legend for. Required. + :type color_map_name: str + :keyword height: The output height of the legend image. Default value is None. + :paramtype height: float + :keyword width: The output width of the legend image. Default value is None. + :paramtype width: float + :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. + :paramtype trim_start: int + :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. + :paramtype trim_end: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6213,11 +6336,14 @@ async def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.StacItemBounds] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_bounds_request( - collection_id=collection_id, - item_id=item_id, + _request = build_data_get_legend_request( + color_map_name=color_map_name, + height=height, + width=width, + trim_start=trim_start, + trim_end=trim_end, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6227,7 +6353,8 @@ async def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _ } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -6243,498 +6370,158 @@ async def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _ map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacItemBounds, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - async def crop_geo_json( + async def register_mosaics_search( self, - collection_id: str, - item_id: str, - format: str, - body: _models.Feature, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, content_type: str = "application/json", + collections: Optional[List[str]] = None, + ids: Optional[List[str]] = None, + bounding_box: Optional[List[float]] = None, + intersects: Optional[_models.Geometry] = None, + query: Optional[dict[str, Any]] = None, + filter: Optional[dict[str, Any]] = None, + datetime: Optional[str] = None, + sort_by: Optional[List[_models.StacSortExtension]] = None, + filter_language: Optional[Union[str, _models.FilterLanguage]] = None, + metadata: Optional[_models.MosaicMetadata] = None, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Geojson Crop. + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. - Create image from a geojson feature. + Register a Search query. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: ~azure.planetarycomputer.models.Feature - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is + None. + :paramtype collections: list[str] + :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. + :paramtype ids: list[str] + :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. + Default value is None. + :paramtype bounding_box: list[float] + :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value + is None. + :paramtype intersects: ~azure.planetarycomputer.models.Geometry + :keyword query: Query. Default value is None. + :paramtype query: dict[str, any] + :keyword filter: Filter. Default value is None. + :paramtype filter: dict[str, any] + :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. + :paramtype datetime: str + :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. + :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] + :keyword filter_language: Query language format used in the filter parameter. Known values are: + "cql-json", "cql2-json", and "cql2-text". Default value is None. + :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage + :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. + :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def crop_geo_json( - self, - collection_id: str, - item_id: str, - format: str, - body: JSON, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterator[bytes]: - """Geojson Crop. + async def register_mosaics_search( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. - Create image from a geojson feature. + Register a Search query. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. + :param body: Required. :type body: JSON - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def crop_geo_json( - self, - collection_id: str, - item_id: str, - format: str, - body: IO[bytes], - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterator[bytes]: - """Geojson Crop. + async def register_mosaics_search( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. - Create image from a geojson feature. + Register a Search query. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. + :param body: Required. :type body: IO[bytes] - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def crop_geo_json( # pylint: disable=too-many-locals + async def register_mosaics_search( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - format: str, - body: Union[_models.Feature, JSON, IO[bytes]], + body: Union[JSON, IO[bytes]] = _Unset, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, + collections: Optional[List[str]] = None, + ids: Optional[List[str]] = None, + bounding_box: Optional[List[float]] = None, + intersects: Optional[_models.Geometry] = None, + query: Optional[dict[str, Any]] = None, + filter: Optional[dict[str, Any]] = None, + datetime: Optional[str] = None, + sort_by: Optional[List[_models.StacSortExtension]] = None, + filter_language: Optional[Union[str, _models.FilterLanguage]] = None, + metadata: Optional[_models.MosaicMetadata] = None, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Geojson Crop. + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. - Create image from a geojson feature. + Register a Search query. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is + None. + :paramtype collections: list[str] + :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. + :paramtype ids: list[str] + :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. + Default value is None. + :paramtype bounding_box: list[float] + :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :paramtype intersects: ~azure.planetarycomputer.models.Geometry + :keyword query: Query. Default value is None. + :paramtype query: dict[str, any] + :keyword filter: Filter. Default value is None. + :paramtype filter: dict[str, any] + :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. + :paramtype datetime: str + :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. + :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] + :keyword filter_language: Query language format used in the filter parameter. Known values are: + "cql-json", "cql2-json", and "cql2-text". Default value is None. + :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage + :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. + :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6749,8 +6536,22 @@ async def crop_geo_json( # pylint: disable=too-many-locals _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TilerMosaicSearchRegistrationResponse] = kwargs.pop("cls", None) + if body is _Unset: + body = { + "bbox": bounding_box, + "collections": collections, + "datetime_property": datetime, + "filter": filter, + "filter_lang": filter_language, + "ids": ids, + "intersects": intersects, + "metadata": metadata, + "query": query, + "sortby": sort_by, + } + body = {k: v for k, v in body.items() if v is not None} content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): @@ -6758,28 +6559,7 @@ async def crop_geo_json( # pylint: disable=too-many-locals else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_data_crop_geo_json_request( - collection_id=collection_id, - item_id=item_id, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - color_formula=color_formula, - coordinate_reference_system=coordinate_reference_system, - resampling=resampling, - max_size=max_size, - height=height, - width=width, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, + _request = build_data_register_mosaics_search_request( content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6791,7 +6571,8 @@ async def crop_geo_json( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -6807,97 +6588,329 @@ async def crop_geo_json( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerMosaicSearchRegistrationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_tilesets( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetList: + """Tileset List. + + Return a list of available tilesets for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetList. The TileSetList is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetList] = kwargs.pop("cls", None) + + _request = build_data_list_tilesets_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetList, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def crop_geo_json_with_dimensions( + @distributed_trace_async + async def get_tileset_metadata( self, collection_id: str, item_id: str, - width: int, - height: int, - format: str, - body: _models.Feature, + tile_matrix_set_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetMetadata: + """Tileset Metadata. + + Return metadata for a specific tileset of a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetMetadata. The TileSetMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_tileset_metadata_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_tile( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - content_type: str = "application/json", + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Geojson Crop. + """Tile Tilematrixsetid Plain. - Create image from a geojson feature. + Create map tile from a dataset (without scale or format in path). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: ~azure.planetarycomputer.models.Feature + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -6930,96 +6943,231 @@ async def crop_geo_json_with_dimensions( "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - - @overload - async def crop_geo_json_with_dimensions( + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_tile_by_format( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - width: int, - height: int, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, format: str, - body: JSON, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - content_type: str = "application/json", + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Geojson Crop. + """Tile Tilematrixsetid Format. - Create image from a geojson feature. + Create map tile from a dataset (with format in path, without scale). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str - :param body: Request GeoJson body. Required. - :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -7052,96 +7200,231 @@ async def crop_geo_json_with_dimensions( "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def crop_geo_json_with_dimensions( + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_by_format_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_tile_by_scale( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - width: int, - height: int, - format: str, - body: IO[bytes], + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - content_type: str = "application/json", + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Geojson Crop. + """Tile Tilematrixsetid Scale. - Create image from a geojson feature. + Create map tile from a dataset (with scale in path, without format). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: IO[bytes] + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -7174,96 +7457,230 @@ async def crop_geo_json_with_dimensions( "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_by_scale_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async - async def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals + async def get_tile_by_scale_and_format( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - width: int, - height: int, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, format: str, - body: Union[_models.Feature, JSON, IO[bytes]], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Geojson Crop. + """Tile Tilematrixsetid. - Create image from a geojson feature. + Create map tile from a dataset (with TileMatrixSetId, scale, and format in path). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str - :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -7296,13 +7713,38 @@ async def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -7315,44 +7757,46 @@ async def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_crop_geo_json_with_dimensions_request( + _request = build_data_get_tile_by_scale_and_format_request( collection_id=collection_id, item_id=item_id, - width=width, - height=height, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, algorithm=algorithm, algorithm_params=algorithm_params, + buffer=buffer, color_formula=color_formula, - coordinate_reference_system=coordinate_reference_system, resampling=resampling, - max_size=max_size, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, - content_type=content_type, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7361,6 +7805,7 @@ async def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7386,391 +7831,447 @@ async def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - async def get_geo_json_statistics( + @distributed_trace_async + async def get_tile_no_tms( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - body: _models.Feature, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - content_type: str = "application/json", + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + ) -> AsyncIterator[bytes]: + """Tile Plain. - Get Statistics from a geojson feature. + Create map tile from a dataset (without TileMatrixSetId, scale or format in path). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param body: Request GeoJson body. Required. - :type body: ~azure.planetarycomputer.models.Feature + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is None. - :paramtype histogram_range: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def get_geo_json_statistics( - self, - collection_id: str, - item_id: str, - body: JSON, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - Get Statistics from a geojson feature. + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param body: Request GeoJson body. Required. - :type body: JSON - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). + _request = build_data_get_tile_no_tms_request( + collection_id=collection_id, + item_id=item_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. + response = pipeline_response.http_response - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson - :raises ~azure.core.exceptions.HttpResponseError: - """ + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - @overload - async def get_geo_json_statistics( + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_tile_no_tms_by_format( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - body: IO[bytes], + z: float, + x: float, + y: float, + format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - content_type: str = "application/json", + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + ) -> AsyncIterator[bytes]: + """Tile Format. - Get Statistics from a geojson feature. + Create map tile from a dataset (with format in path, without TileMatrixSetId or scale). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param body: Request GeoJson body. Required. - :type body: IO[bytes] + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is None. - :paramtype histogram_range: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def get_geo_json_statistics( # pylint: disable=too-many-locals - self, - collection_id: str, - item_id: str, - body: Union[_models.Feature, JSON, IO[bytes]], - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. - - Get Statistics from a geojson feature. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7781,39 +8282,46 @@ async def get_geo_json_statistics( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacItemStatisticsGeoJson] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_geo_json_statistics_request( + _request = build_data_get_tile_no_tms_by_format_request( collection_id=collection_id, item_id=item_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, - coordinate_reference_system=coordinate_reference_system, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + scale=scale, + buffer=buffer, + color_formula=color_formula, resampling=resampling, - max_size=max_size, - categorical=categorical, - categories_pixels=categories_pixels, - percentiles=percentiles, - histogram_bins=histogram_bins, - histogram_range=histogram_range, - content_type=content_type, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7822,7 +8330,8 @@ async def get_geo_json_statistics( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -7838,242 +8347,127 @@ async def get_geo_json_statistics( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacItemStatisticsGeoJson, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_info_geo_json( - self, collection_id: str, item_id: str, *, assets: Optional[List[str]] = None, **kwargs: Any - ) -> _models.TilerInfoGeoJsonFeature: - """Info Geojson. - - Return Info Geojson. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :return: TilerInfoGeoJsonFeature. The TilerInfoGeoJsonFeature is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerInfoGeoJsonFeature - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TilerInfoGeoJsonFeature] = kwargs.pop("cls", None) - - _request = build_data_get_info_geo_json_request( - collection_id=collection_id, - item_id=item_id, - assets=assets, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerInfoGeoJsonFeature, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_item_asset_details( - self, collection_id: str, item_id: str, *, assets: Optional[List[str]] = None, **kwargs: Any - ) -> _models.TilerInfoMapResponse: - """Info. - - Return dataset's basic info. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :return: TilerInfoMapResponse. The TilerInfoMapResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerInfoMapResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TilerInfoMapResponse] = kwargs.pop("cls", None) - - _request = build_data_get_item_asset_details_request( - collection_id=collection_id, - item_id=item_id, - assets=assets, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerInfoMapResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_part( # pylint: disable=too-many-locals + async def get_tile_no_tms_by_scale( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - minx: float, - miny: float, - maxx: float, - maxy: float, - format: str, + z: float, + x: float, + y: float, + scale: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Part. + """Tile Scale. - Create image from part of a dataset. + Create map tile from a dataset (with scale in path, without TileMatrixSetId or format). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param minx: Bounding box min X. Required. - :type minx: float - :param miny: Bounding box min Y. Required. - :type miny: float - :param maxx: Bounding box max X. Required. - :type maxx: float - :param maxy: Bounding box max Y. Required. - :type maxy: float - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -8106,13 +8500,38 @@ async def get_part( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -8130,33 +8549,40 @@ async def get_part( # pylint: disable=too-many-locals cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_part_request( + _request = build_data_get_tile_no_tms_by_scale_request( collection_id=collection_id, item_id=item_id, - minx=minx, - miny=miny, - maxx=maxx, - maxy=maxy, - format=format, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, algorithm=algorithm, algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + buffer=buffer, color_formula=color_formula, - dst_crs=dst_crs, - coordinate_reference_system=coordinate_reference_system, resampling=resampling, - max_size=max_size, - height=height, - width=width, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8166,6 +8592,7 @@ async def get_part( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8191,7 +8618,7 @@ async def get_part( # pylint: disable=too-many-locals response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8199,91 +8626,109 @@ async def get_part( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace_async - async def get_part_with_dimensions( # pylint: disable=too-many-locals + async def get_tile_no_tms_by_scale_and_format( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - minx: float, - miny: float, - maxx: float, - maxy: float, - width: int, - height: int, + z: float, + x: float, + y: float, + scale: float, format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Part. + """Tile. - Create image from part of a dataset. + Create map tile from a dataset (with scale and format in path, without TileMatrixSetId). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param minx: Bounding box min X. Required. - :type minx: float - :param miny: Bounding box min Y. Required. - :type miny: float - :param maxx: Bounding box max X. Required. - :type maxx: float - :param maxy: Bounding box max Y. Required. - :type maxy: float - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -8316,13 +8761,38 @@ async def get_part_with_dimensions( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -8340,33 +8810,40 @@ async def get_part_with_dimensions( # pylint: disable=too-many-locals cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_part_with_dimensions_request( + _request = build_data_get_tile_no_tms_by_scale_and_format_request( collection_id=collection_id, item_id=item_id, - minx=minx, - miny=miny, - maxx=maxx, - maxy=maxy, - width=width, - height=height, + z=z, + x=x, + y=y, + scale=scale, format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, algorithm=algorithm, algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + buffer=buffer, color_formula=color_formula, - dst_crs=dst_crs, - coordinate_reference_system=coordinate_reference_system, resampling=resampling, - max_size=max_size, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8376,6 +8853,7 @@ async def get_part_with_dimensions( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8401,145 +8879,32 @@ async def get_part_with_dimensions( # pylint: disable=too-many-locals response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def get_point( # pylint: disable=too-many-locals - self, - collection_id: str, - item_id: str, - longitude: float, - latitude: float, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - **kwargs: Any - ) -> _models.TilerCoreModelsResponsesPoint: - """Point. - - Get Point value for a dataset. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param longitude: Longitude. Required. - :type longitude: float - :param latitude: Latitude. Required. - :type latitude: float - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) - - _request = build_data_get_point_request( - collection_id=collection_id, - item_id=item_id, - longitude=longitude, - latitude=latitude, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - coordinate_reference_system=coordinate_reference_system, - resampling=resampling, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_preview( # pylint: disable=too-many-locals + @overload + async def crop_feature_geo_json( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, + body: _models.Feature, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - format: Optional[Union[str, _models.TilerImageFormat]] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, max_size: Optional[int] = None, height: Optional[int] = None, @@ -8548,42 +8913,60 @@ async def get_preview( # pylint: disable=too-many-locals color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", **kwargs: Any ) -> AsyncIterator[bytes]: - """Preview. + """Geojson Feature. - Create preview of a dataset. + Create image from a geojson feature (without format in path). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: - "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. - :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling @@ -8626,110 +9009,67 @@ async def get_preview( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_preview_request( - collection_id=collection_id, - item_id=item_id, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - format=format, - color_formula=color_formula, - dst_crs=dst_crs, - resampling=resampling, - max_size=max_size, - height=height, - width=width, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @distributed_trace_async - async def get_preview_with_format( # pylint: disable=too-many-locals + @overload + async def crop_feature_geo_json( # pylint: disable=too-many-locals self, collection_id: str, item_id: str, - format: str, + body: JSON, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, max_size: Optional[int] = None, height: Optional[int] = None, @@ -8738,41 +9078,60 @@ async def get_preview_with_format( # pylint: disable=too-many-locals color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", **kwargs: Any ) -> AsyncIterator[bytes]: - """Preview. + """Geojson Feature. - Create preview of a dataset. + Create image from a geojson feature (without format in path). :param collection_id: STAC Collection Identifier. Required. :type collection_id: str :param item_id: STAC Item Identifier. Required. :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling @@ -8815,180 +9174,379 @@ async def get_preview_with_format( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :return: AsyncIterator[bytes] + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_preview_with_format_request( - collection_id=collection_id, - item_id=item_id, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - color_formula=color_formula, - dst_crs=dst_crs, - resampling=resampling, - max_size=max_size, - height=height, - width=width, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore @overload - async def create_static_image( + async def crop_feature_geo_json( # pylint: disable=too-many-locals self, collection_id: str, - body: _models.ImageParameters, + item_id: str, + body: IO[bytes], *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. - - Create a new image export. - - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Image request body. Required. - :type body: ~azure.planetarycomputer.models.ImageParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_static_image( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. - - Create a new image export. - - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Image request body. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_static_image( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. + ) -> AsyncIterator[bytes]: + """Geojson Feature. - Create a new image export. + Create image from a geojson feature (without format in path). - :param collection_id: STAC Collection ID. Required. + :param collection_id: STAC Collection Identifier. Required. :type collection_id: str - :param body: Image request body. Required. + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_static_image( - self, collection_id: str, body: Union[_models.ImageParameters, JSON, IO[bytes]], **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. + async def crop_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature. - Create a new image export. + Create image from a geojson feature (without format in path). - :param collection_id: STAC Collection ID. Required. + :param collection_id: STAC Collection Identifier. Required. :type collection_id: str - :param body: Image request body. Is one of the following types: ImageParameters, JSON, - IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.ImageParameters or JSON or IO[bytes] - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -8996,7 +9554,7 @@ async def create_static_image( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImageResponse] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -9005,8 +9563,38 @@ async def create_static_image( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_data_create_static_image_request( + _request = build_data_crop_feature_geo_json_request( collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + format=format, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -9018,7 +9606,8 @@ async def create_static_image( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -9034,162 +9623,17114 @@ async def create_static_image( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.ImageResponse, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def get_static_image(self, collection_id: str, id: str, **kwargs: Any) -> AsyncIterator[bytes]: - """Get Static Image. + @overload + async def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Format. - Fetch an existing image export by ID. + Create image from a geojson feature with format. - :param collection_id: STAC Collection ID. Required. + :param collection_id: STAC Collection Identifier. Required. :type collection_id: str - :param id: Image export ID. Required. - :type id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_feature_geo_json_format_request( + collection_id=collection_id, + item_id=item_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_feature_geo_json_width_by_height_request( + collection_id=collection_id, + item_id=item_id, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_bounds( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.StacItemBounds: + """Item Bounds. + + Return the bounds for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: StacItemBounds. The StacItemBounds is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemBounds + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacItemBounds] = kwargs.pop("cls", None) + + _request = build_data_get_item_bounds_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItemBounds, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_info( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + assets: Optional[List[str]] = None, + **kwargs: Any + ) -> _models.TilerInfoMapResponse: + """Item Info. + + Return dataset's basic info for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :return: TilerInfoMapResponse. The TilerInfoMapResponse is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerInfoMapResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerInfoMapResponse] = kwargs.pop("cls", None) + + _request = build_data_get_item_info_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + assets=assets, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerInfoMapResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_info_geo_json( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + assets: Optional[List[str]] = None, + **kwargs: Any + ) -> _models.TilerInfoGeoJsonFeature: + """Item Info Geojson. + + Return info as GeoJSON for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :return: TilerInfoGeoJsonFeature. The TilerInfoGeoJsonFeature is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerInfoGeoJsonFeature + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerInfoGeoJsonFeature] = kwargs.pop("cls", None) + + _request = build_data_get_item_info_geo_json_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + assets=assets, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerInfoGeoJsonFeature, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_item_available_assets( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> List[str]: + """Item Available Assets. + + Return a list of supported assets for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_data_list_item_available_assets_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[str], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_asset_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + asset_band_indices: Optional[List[str]] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + asset_expression: Optional[List[str]] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any + ) -> _models.AssetStatisticsResponse: + """Item Asset Statistics. + + Per asset statistics for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword asset_expression: Per asset band expression. Default value is None. + :paramtype asset_expression: list[str] + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :return: AssetStatisticsResponse. The AssetStatisticsResponse is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.AssetStatisticsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AssetStatisticsResponse] = kwargs.pop("cls", None) + + _request = build_data_get_item_asset_statistics_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + asset_band_indices=asset_band_indices, + no_data=no_data, + unscale=unscale, + reproject=reproject, + resampling=resampling, + max_size=max_size, + categorical=categorical, + categories_pixels=categories_pixels, + percentiles=percentiles, + histogram_bins=histogram_bins, + histogram_range=histogram_range, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + asset_expression=asset_expression, + height=height, + width=width, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AssetStatisticsResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_item_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any + ) -> _models.TilerStacItemStatistics: + """Item Statistics. + + Merged assets statistics for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :return: TilerStacItemStatistics. The TilerStacItemStatistics is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerStacItemStatistics + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerStacItemStatistics] = kwargs.pop("cls", None) + + _request = build_data_list_item_statistics_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + resampling=resampling, + max_size=max_size, + categorical=categorical, + categories_pixels=categories_pixels, + percentiles=percentiles, + histogram_bins=histogram_bins, + histogram_range=histogram_range, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + algorithm=algorithm, + algorithm_params=algorithm_params, + height=height, + width=width, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerStacItemStatistics, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StacItemStatisticsGeoJson] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_get_item_geo_json_statistics_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + categorical=categorical, + categories_pixels=categories_pixels, + percentiles=percentiles, + histogram_bins=histogram_bins, + histogram_range=histogram_range, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + algorithm=algorithm, + algorithm_params=algorithm_params, + height=height, + width=width, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItemStatisticsGeoJson, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_tile_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Item TileJson. + + Return TileJSON document for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_item_tile_json_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_tile_json_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Item TileJson Tilematrixsetid As Path. + + Return TileJSON document for a STAC item with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_item_tile_json_tms_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_wmts_capabilities( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Item Wmts. + + OGC WMTS endpoint for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_wmts_capabilities_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_wmts_capabilities_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Item Wmts Tilematrixsetid As Path. + + OGC WMTS endpoint for a STAC item with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_wmts_capabilities_tms_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_point( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + longitude: float, + latitude: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any + ) -> _models.TilerCoreModelsResponsesPoint: + """Item Point. + + Get point value for a STAC item dataset. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) + + _request = build_data_get_item_point_request( + collection_id=collection_id, + item_id=item_id, + longitude=longitude, + latitude=latitude, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_preview( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + color_formula: Optional[str] = None, + dst_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Item Preview. + + Create preview of a STAC item dataset. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword dst_crs: Output Coordinate Reference System. Default value is None. + :paramtype dst_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_preview_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + color_formula=color_formula, + dst_crs=dst_crs, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_preview_with_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + dst_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Item Preview With Format. + + Create preview of a STAC item dataset with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword dst_crs: Output Coordinate Reference System. Default value is None. + :paramtype dst_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_preview_with_format_request( + collection_id=collection_id, + item_id=item_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + dst_crs=dst_crs, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_bbox_crop( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Item Bbox. + + Create an image from part of a STAC item dataset (bounding box crop). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_bbox_crop_request( + collection_id=collection_id, + item_id=item_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_item_bbox_crop_with_dimensions( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Item Bbox With Dimensions. + + Create an image from part of a STAC item dataset (bounding box crop with dimensions). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param width: Force output image width. Required. + :type width: int + :param height: Force output image height. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_bbox_crop_with_dimensions_request( + collection_id=collection_id, + item_id=item_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + resampling=resampling, + max_size=max_size, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_collection_tilesets( # pylint: disable=too-many-locals + self, + collection_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetList: + """Collection Tileset List. + + Return a list of available tilesets for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetList. The TileSetList is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetList] = kwargs.pop("cls", None) + + _request = build_data_list_collection_tilesets_request( + collection_id=collection_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tileset_metadata( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetMetadata: + """Collection Tileset Metadata. + + Return metadata for a specific tileset of a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetMetadata. The TileSetMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tileset_metadata_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_by_scale_and_format( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Tilematrixsetid. + + Create map tile for a STAC collection (with TileMatrixSetId, scale, and format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_by_scale_and_format_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Tilematrixsetid Plain. + + Create map tile for a STAC collection (with TileMatrixSetId, without scale or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_by_format( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Tilematrixsetid Format. + + Create map tile for a STAC collection (with TileMatrixSetId and format, without scale). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_by_format_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_by_scale( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Tilematrixsetid Scale. + + Create map tile for a STAC collection (with TileMatrixSetId and scale, without format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_by_scale_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_no_tms_by_scale_and_format( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile. + + Create map tile for a STAC collection (without TileMatrixSetId, with scale and format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles (default: + "1"). Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp) (default: "png"). + Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_by_scale_and_format_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_no_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Plain. + + Create map tile for a STAC collection (without TileMatrixSetId, scale, or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_no_tms_by_format( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Format. + + Create map tile for a STAC collection (with format, without TileMatrixSetId or scale). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_by_format_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_no_tms_by_scale( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Tile Scale. + + Create map tile for a STAC collection (with scale, without TileMatrixSetId or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_by_scale_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_json( # pylint: disable=too-many-locals + self, + collection_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Collection TileJson. + + Return TileJSON document for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_json_request( + collection_id=collection_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_tile_json_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Collection TileJson Tilematrixsetid As Path. + + Return TileJSON document for a STAC collection with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_json_tms_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_wmts_capabilities( + self, + collection_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Wmts. + + OGC WMTS endpoint for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_wmts_capabilities_request( + collection_id=collection_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_wmts_capabilities_tms( + self, + collection_id: str, + tile_matrix_set_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Wmts Tilematrixsetid As Path. + + OGC WMTS endpoint for a STAC collection with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_wmts_capabilities_tms_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_assets_for_tile( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> List[_models.TilerAssetGeoJson]: + """Collection Assets For Tile Tilematrixsetid As Path. + + Return a list of assets which overlap a given tile for a STAC collection (with + TileMatrixSetId). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: list of TilerAssetGeoJson + :rtype: list[~azure.planetarycomputer.models.TilerAssetGeoJson] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TilerAssetGeoJson]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_assets_for_tile_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.TilerAssetGeoJson], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_assets_for_tile_no_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + **kwargs: Any + ) -> List[Any]: + """Collection Assets For Tile. + + Return a list of assets which overlap a given tile for a STAC collection (without + TileMatrixSetId). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_assets_for_tile_no_tms_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + tile_matrix_set_id=tile_matrix_set_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_assets_for_bbox( # pylint: disable=too-many-locals + self, + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any + ) -> List[Any]: + """Collection Assets For Bbox. + + Return a list of assets which overlap a given bounding box for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_assets_for_bbox_request( + collection_id=collection_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_info(self, collection_id: str, **kwargs: Any) -> _models.TilerStacSearchRegistration: + """Collection Info. + + Return search query info from a STAC collection identifier. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :return: TilerStacSearchRegistration. The TilerStacSearchRegistration is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerStacSearchRegistration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerStacSearchRegistration] = kwargs.pop("cls", None) + + _request = build_data_get_collection_info_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerStacSearchRegistration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_bbox_crop( # pylint: disable=too-many-locals + self, + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Bbox. + + Create an image from part of a STAC collection dataset (bounding box crop). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_bbox_crop_request( + collection_id=collection_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_bbox_crop_with_dimensions( # pylint: disable=too-many-locals + self, + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Bbox With Dimensions. + + Create an image from part of a STAC collection dataset (bounding box crop with dimensions). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param width: Force output image width. Required. + :type width: int + :param height: Force output image height. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_bbox_crop_with_dimensions_request( + collection_id=collection_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_collection_feature_geo_json_request( + collection_id=collection_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + format=format, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_collection_feature_geo_json_format_request( + collection_id=collection_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_collection_feature_geo_json_width_by_height_request( + collection_id=collection_id, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_point( # pylint: disable=too-many-locals + self, + collection_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any + ) -> _models.TilerCoreModelsResponsesPoint: + """Collection Point. + + Get Point value for a collection dataset. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) + + _request = build_data_get_collection_point_request( + collection_id=collection_id, + longitude=longitude, + latitude=latitude, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_collection_point_assets( # pylint: disable=too-many-locals + self, + collection_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any + ) -> List[_models.StacItemPointAsset]: + """Collection Point Assets. + + Return a list of assets for a given point in a collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of StacItemPointAsset + :rtype: list[~azure.planetarycomputer.models.StacItemPointAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.StacItemPointAsset]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_point_assets_request( + collection_id=collection_id, + longitude=longitude, + latitude=latitude, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.StacItemPointAsset], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_searches_tilesets( + self, + search_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetList: + """Searches Tileset List. + + Return a list of available tilesets for a mosaic search. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetList. The TileSetList is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetList] = kwargs.pop("cls", None) + + _request = build_data_list_searches_tilesets_request( + search_id=search_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_tileset_metadata( + self, + search_id: str, + tile_matrix_set_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetMetadata: + """Searches Tileset Metadata. + + Return metadata for a specific tileset of a mosaic search. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetMetadata. The TileSetMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tileset_metadata_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_tile_by_scale_and_format( # pylint: disable=too-many-locals + self, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Tile Tilematrixsetid. + + Create map tile (with TileMatrixSetId, scale, and format in path). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_by_scale_and_format_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_tile( # pylint: disable=too-many-locals + self, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Tile Tilematrixsetid Plain. + + Create map tile (with TileMatrixSetId, without scale or format). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_tile_by_format( # pylint: disable=too-many-locals + self, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Tile Tilematrixsetid Format. + + Create map tile (with TileMatrixSetId and format, without scale). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_by_format_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_tile_by_scale( # pylint: disable=too-many-locals + self, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Tile Tilematrixsetid Scale. + + Create map tile (with TileMatrixSetId and scale, without format). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_by_scale_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_assets_for_tile( # pylint: disable=too-many-locals + self, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + collection_id: str, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + **kwargs: Any + ) -> List[_models.TilerAssetGeoJson]: + """Searches Assets For Tile Tilematrixsetid As Path. + + Return a list of assets which overlap a given tile. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword collection_id: STAC Collection Identifier. Required. + :paramtype collection_id: str + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :return: list of TilerAssetGeoJson + :rtype: list[~azure.planetarycomputer.models.TilerAssetGeoJson] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TilerAssetGeoJson]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_assets_for_tile_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + collection_id=collection_id, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.TilerAssetGeoJson], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_tile_json_tms( # pylint: disable=too-many-locals + self, + search_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Searches TileJson Tilematrixsetid As Path. + + Return TileJSON document for a search with TileMatrixSetId as path. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_json_tms_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + min_zoom=min_zoom, + max_zoom=max_zoom, + tile_format=tile_format, + tile_scale=tile_scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_wmts_capabilities_tms( + self, + search_id: str, + tile_matrix_set_id: str, + *, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Wmts Tilematrixsetid As Path. + + OGC WMTS endpoint with TileMatrixSetId as path. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_wmts_capabilities_tms_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_info(self, search_id: str, **kwargs: Any) -> _models.TilerStacSearchRegistration: + """Searches Info. + + Get Search query metadata. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :return: TilerStacSearchRegistration. The TilerStacSearchRegistration is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerStacSearchRegistration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerStacSearchRegistration] = kwargs.pop("cls", None) + + _request = build_data_get_searches_info_request( + search_id=search_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerStacSearchRegistration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_bbox_crop( # pylint: disable=too-many-locals + self, + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Bbox. + + Create an image from part of a dataset (bounding box crop). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_bbox_crop_request( + search_id=search_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_bbox_crop_with_dimensions( # pylint: disable=too-many-locals + self, + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Bbox With Dimensions. + + Create an image from part of a dataset (bounding box crop with dimensions). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param width: Force output image width. Required. + :type width: int + :param height: Force output image height. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_bbox_crop_with_dimensions_request( + search_id=search_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_bbox_assets( # pylint: disable=too-many-locals + self, + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any + ) -> List[Any]: + """Searches Assets For Bbox. + + Return a list of assets which overlap a given bounding box for a search. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_bbox_assets_request( + search_id=search_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def crop_searches_feature_geo_json( # pylint: disable=too-many-locals + self, + search_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_searches_feature_geo_json( # pylint: disable=too-many-locals + self, + search_id: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_searches_feature_geo_json( # pylint: disable=too-many-locals + self, + search_id: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def crop_searches_feature_geo_json( # pylint: disable=too-many-locals + self, + search_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_searches_feature_geo_json_request( + search_id=search_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + format=format, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals + self, + search_id: str, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals + self, + search_id: str, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals + self, + search_id: str, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_static_image_request( - collection_id=collection_id, - id=id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore @distributed_trace_async - async def list_statistics( # pylint: disable=too-many-locals + async def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, + search_id: str, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, **kwargs: Any - ) -> _models.TilerStacItemStatistics: - """Statistics. + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature Crop With Format. - Merged assets statistics. + Create image from a geojson feature with format. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is None. - :paramtype histogram_range: str - :return: TilerStacItemStatistics. The TilerStacItemStatistics is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerStacItemStatistics + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9200,28 +26741,59 @@ async def list_statistics( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TilerStacItemStatistics] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_list_statistics_request( - collection_id=collection_id, - item_id=item_id, + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_searches_feature_geo_json_format_request( + search_id=search_id, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, - resampling=resampling, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, max_size=max_size, - categorical=categorical, - categories_pixels=categories_pixels, - percentiles=percentiles, - histogram_bins=histogram_bins, - histogram_range=histogram_range, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -9230,7 +26802,8 @@ async def list_statistics( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -9246,95 +26819,156 @@ async def list_statistics( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerStacItemStatistics, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def get_tile_json( # pylint: disable=too-many-locals + @overload + async def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals self, - collection_id: str, - item_id: str, - tile_matrix_set_id: str, + search_id: str, + width: int, + height: int, + format: str, + body: _models.Feature, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, color_formula: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any - ) -> _models.TileJsonMetadata: - """TileJson Tilematrixsetid As Path. + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature Crop With Dimensions. - Return the TileJson Tilematrixsetid As a path. + Create image from a geojson feature with dimensions. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword tile_format: Default will be automatically defined if the output image needs a mask - (png) or - not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". - Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -9367,171 +27001,161 @@ async def get_tile_json( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) - - _request = build_data_get_tile_json_request( - collection_id=collection_id, - item_id=item_id, - tile_matrix_set_id=tile_matrix_set_id, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - tile_format=tile_format, - tile_scale=tile_scale, - min_zoom=min_zoom, - max_zoom=max_zoom, - buffer=buffer, - color_formula=color_formula, - resampling=resampling, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TileJsonMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized # type: ignore - - @distributed_trace_async - async def get_tile( # pylint: disable=too-many-locals + @overload + async def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals self, - collection_id: str, - item_id: str, - tile_matrix_set_id: str, - z: float, - x: float, - y: float, - scale: float, + search_id: str, + width: int, + height: int, format: str, + body: JSON, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - buffer: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, color_formula: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - subdataset_name: Optional[str] = None, - subdataset_bands: Optional[List[str]] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any ) -> AsyncIterator[bytes]: - """Tile Tilematrixsetid As Path. + """Searches Geojson Feature Crop With Dimensions. - Create map tile from a dataset. + Create image from a geojson feature with dimensions. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str - :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and - representing the scaleDenominator the tile. Required. - :type z: float - :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the - MatrixHeight-1 for the selected TileMatrix. Required. - :type x: float - :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the - MatrixWidth-1 for the selected TileMatrix. Required. - :type y: float - :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. - :type scale: float + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -9564,179 +27188,348 @@ async def get_tile( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. - :paramtype subdataset_name: str - :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is - None. - :paramtype subdataset_bands: list[str] + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_tile_request( - collection_id=collection_id, - item_id=item_id, - tile_matrix_set_id=tile_matrix_set_id, - z=z, - x=x, - y=y, - scale=scale, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - buffer=buffer, - color_formula=color_formula, - resampling=resampling, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - subdataset_name=subdataset_name, - subdataset_bands=subdataset_bands, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + @overload + async def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + search_id: str, + width: int, + height: int, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Geojson Feature Crop With Dimensions. - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + Create image from a geojson feature with dimensions. - return deserialized # type: ignore + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get_wmts_capabilities( # pylint: disable=too-many-locals + async def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals self, - collection_id: str, - item_id: str, - tile_matrix_set_id: str, + search_id: str, + width: int, + height: int, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, color_formula: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Wmts Tilematrixsetid As Path. + """Searches Geojson Feature Crop With Dimensions. - OGC WMTS endpoint. + Create image from a geojson feature with dimensions. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", - "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -9769,13 +27562,19 @@ async def get_wmts_capabilities( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -9788,35 +27587,59 @@ async def get_wmts_capabilities( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_wmts_capabilities_request( - collection_id=collection_id, - item_id=item_id, - tile_matrix_set_id=tile_matrix_set_id, + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_searches_feature_geo_json_width_by_height_request( + search_id=search_id, + width=width, + height=height, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, - tile_format=tile_format, - tile_scale=tile_scale, - min_zoom=min_zoom, - max_zoom=max_zoom, - buffer=buffer, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, color_formula=color_formula, + collection=collection, resampling=resampling, + pixel_selection=pixel_selection, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -9825,6 +27648,7 @@ async def get_wmts_capabilities( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9843,129 +27667,57 @@ async def get_wmts_capabilities( # pylint: disable=too-many-locals response_headers = {} response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_class_map_legend( - self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any - ) -> _models.ClassMapLegendResponse: - """Get ClassMap Legend. - - Generate values and color swatches mapping for a given classmap. - - :param classmap_name: classmap name. Required. - :type classmap_name: str - :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. - :paramtype trim_start: int - :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. - :paramtype trim_end: int - :return: ClassMapLegendResponse. The ClassMapLegendResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ClassMapLegendResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ClassMapLegendResponse] = kwargs.pop("cls", None) - - _request = build_data_get_class_map_legend_request( - classmap_name=classmap_name, - trim_start=trim_start, - trim_end=trim_end, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.ClassMapLegendResponse, response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_interval_legend( - self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any - ) -> List[List[List[int]]]: - """Get Interval Legend. - - Generate values and color swatches mapping for a given interval classmap. - - Returns a color map for intervals, where each interval is defined by: - - * A numeric range `[min, max]` representing the interval boundaries. - * An RGBA color `[red, green, blue, alpha]` associated with the interval. - - The response is a 2D array of interval definitions, where each element is a pair: - - * The first element is an array of two numbers `[min, max]` defining the interval. - * The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA - color. - - Example: - - .. code-block:: json - - [ - [ - [-2, 0], [0, 0, 0, 0] - ], - [ - [1, 32], [255, 255, 178, 255] - ] - ] + return cls(pipeline_response, deserialized, response_headers) # type: ignore - This example defines two intervals: + return deserialized # type: ignore - * The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black). - * The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow). + @distributed_trace_async + async def get_searches_wmts_capabilities( + self, + search_id: str, + *, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """Searches Wmts. - :param classmap_name: classmap name. Required. - :type classmap_name: str - :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. - :paramtype trim_start: int - :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. - :paramtype trim_end: int - :return: list of list of list of int - :rtype: list[list[list[int]]] + OGC WMTS endpoint. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9979,12 +27731,15 @@ async def get_interval_legend( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[List[List[int]]]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_interval_legend_request( - classmap_name=classmap_name, - trim_start=trim_start, - trim_end=trim_end, + _request = build_data_get_searches_wmts_capabilities_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9994,7 +27749,8 @@ async def get_interval_legend( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10013,10 +27769,7 @@ async def get_interval_legend( response_headers = {} response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[List[List[int]]], response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -10024,36 +27777,195 @@ async def get_interval_legend( return deserialized # type: ignore @distributed_trace_async - async def get_legend( + async def get_searches_tile_json( # pylint: disable=too-many-locals self, - color_map_name: str, + search_id: str, *, - height: Optional[float] = None, - width: Optional[float] = None, - trim_start: Optional[int] = None, - trim_end: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + padding: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection_id: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + rescale: Optional[List[str]] = None, + colormap_name: Optional[Union[str, _models.ColorMapNames]] = None, + colormap: Optional[str] = None, + return_mask: Optional[bool] = None, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Get Legend. - - Generate a legend image for a given colormap. + ) -> _models.TileJsonMetadata: + """Searches TileJson. - If the colormap has non-contiguous values at the beginning or end, - which aren't desired in the output image, they can be trimmed by specifying - the number of values to trim. + Return TileJSON document for a search. - :param color_map_name: The name of the registered colormap to generate a legend for. Required. - :type color_map_name: str - :keyword height: The output height of the legend image. Default value is None. - :paramtype height: float - :keyword width: The output width of the legend image. Default value is None. - :paramtype width: float - :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. - :paramtype trim_start: int - :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. - :paramtype trim_end: int - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection_id: STAC Collection ID. Default value is None. + :paramtype collection_id: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword colormap_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype colormap_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword colormap: JSON encoded custom Colormap. Default value is None. + :paramtype colormap: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10067,14 +27979,46 @@ async def get_legend( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) - _request = build_data_get_legend_request( - color_map_name=color_map_name, - height=height, - width=width, - trim_start=trim_start, - trim_end=trim_end, + _request = build_data_get_searches_tile_json_request( + search_id=search_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + padding=padding, + buffer=buffer, + color_formula=color_formula, + collection_id=collection_id, + resampling=resampling, + pixel_selection=pixel_selection, + algorithm=algorithm, + algorithm_params=algorithm_params, + rescale=rescale, + colormap_name=colormap_name, + colormap=colormap, + return_mask=return_mask, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10084,7 +28028,8 @@ async def get_legend( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10100,62 +28045,210 @@ async def get_legend( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_mosaics_assets_for_point( + async def get_searches_tile_no_tms( # pylint: disable=too-many-locals self, search_id: str, - longitude: float, - latitude: float, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> List[_models.StacItemPointAsset]: - """Assets For Point. + ) -> AsyncIterator[bytes]: + """Searches Tile Plain. - Return a list of assets for a given point. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param longitude: Longitude. Required. - :type longitude: float - :param latitude: Latitude. Required. - :type latitude: float - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). - Default value is None. + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :return: list of StacItemPointAsset - :rtype: list[~azure.planetarycomputer.models.StacItemPointAsset] + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10169,18 +28262,47 @@ async def get_mosaics_assets_for_point( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.StacItemPointAsset]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_assets_for_point_request( + _request = build_data_get_searches_tile_no_tms_request( search_id=search_id, - longitude=longitude, - latitude=latitude, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, - coordinate_reference_system=coordinate_reference_system, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10190,7 +28312,8 @@ async def get_mosaics_assets_for_point( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10206,41 +28329,72 @@ async def get_mosaics_assets_for_point( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[_models.StacItemPointAsset], response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_mosaics_assets_for_tile( + async def get_searches_tile_no_tms_by_format( # pylint: disable=too-many-locals self, search_id: str, - tile_matrix_set_id: str, z: float, x: float, y: float, + format: str, *, - collection_id: str, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> List[_models.TilerAssetGeoJson]: - """Assets For Tile Tilematrixsetid As Path. + ) -> AsyncIterator[bytes]: + """Searches Tile Format. - Return a list of assets which overlap a given tile. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile. Required. :type z: float @@ -10250,26 +28404,140 @@ async def get_mosaics_assets_for_tile( :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix. Required. :type y: float - :keyword collection_id: STAC Collection Identifier. Required. - :paramtype collection_id: str - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). - Default value is None. + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :return: list of TilerAssetGeoJson - :rtype: list[~azure.planetarycomputer.models.TilerAssetGeoJson] + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10283,20 +28551,47 @@ async def get_mosaics_assets_for_tile( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.TilerAssetGeoJson]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_assets_for_tile_request( + _request = build_data_get_searches_tile_no_tms_by_format_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, z=z, x=x, y=y, - collection_id=collection_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10306,7 +28601,8 @@ async def get_mosaics_assets_for_tile( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10322,221 +28618,215 @@ async def get_mosaics_assets_for_tile( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[_models.TilerAssetGeoJson], response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_mosaics_search_info(self, search_id: str, **kwargs: Any) -> _models.TilerStacSearchRegistration: - """Info Search. - - Get Search query metadata. - - :param search_id: Search Id (pgSTAC Search Hash). Required. - :type search_id: str - :return: TilerStacSearchRegistration. The TilerStacSearchRegistration is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerStacSearchRegistration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TilerStacSearchRegistration] = kwargs.pop("cls", None) - - _request = build_data_get_mosaics_search_info_request( - search_id=search_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerStacSearchRegistration, response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - async def register_mosaics_search( - self, - *, - content_type: str = "application/json", - collections: Optional[List[str]] = None, - ids: Optional[List[str]] = None, - bounding_box: Optional[float] = None, - intersects: Optional[_models.Geometry] = None, - query: Optional[dict[str, Any]] = None, - filter: Optional[dict[str, Any]] = None, - datetime: Optional[str] = None, - sort_by: Optional[List[_models.StacSortExtension]] = None, - filter_language: Optional[Union[str, _models.FilterLanguage]] = None, - metadata: Optional[_models.MosaicMetadata] = None, - **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. - - Register a Search query. - - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is - None. - :paramtype collections: list[str] - :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. - :paramtype ids: list[str] - :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. - Default value is None. - :paramtype bounding_box: float - :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value - is None. - :paramtype intersects: ~azure.planetarycomputer.models.Geometry - :keyword query: Query. Default value is None. - :paramtype query: dict[str, any] - :keyword filter: Filter. Default value is None. - :paramtype filter: dict[str, any] - :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. - :paramtype datetime: str - :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. - :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] - :keyword filter_language: Query language format used in the filter parameter. Known values are: - "cql-json", "cql2-json", and "cql2-text". Default value is None. - :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage - :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. - :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def register_mosaics_search( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. - - Register a Search query. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def register_mosaics_search( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. - - Register a Search query. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def register_mosaics_search( # pylint: disable=too-many-locals + async def get_searches_tile_no_tms_by_scale( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + search_id: str, + z: float, + x: float, + y: float, + scale: float, *, - collections: Optional[List[str]] = None, - ids: Optional[List[str]] = None, - bounding_box: Optional[float] = None, - intersects: Optional[_models.Geometry] = None, - query: Optional[dict[str, Any]] = None, - filter: Optional[dict[str, Any]] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, datetime: Optional[str] = None, - sort_by: Optional[List[_models.StacSortExtension]] = None, - filter_language: Optional[Union[str, _models.FilterLanguage]] = None, - metadata: Optional[_models.MosaicMetadata] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. + ) -> AsyncIterator[bytes]: + """Searches Tile Scale. - Register a Search query. + The most basic operation. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is None. - :paramtype collections: list[str] - :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. - :paramtype ids: list[str] - :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). Default value is None. - :paramtype bounding_box: float - :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value - is None. - :paramtype intersects: ~azure.planetarycomputer.models.Geometry - :keyword query: Query. Default value is None. - :paramtype query: dict[str, any] - :keyword filter: Filter. Default value is None. - :paramtype filter: dict[str, any] - :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. :paramtype datetime: str - :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. - :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] - :keyword filter_language: Query language format used in the filter parameter. Known values are: - "cql-json", "cql2-json", and "cql2-text". Default value is None. - :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage - :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. - :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10547,37 +28837,51 @@ async def register_mosaics_search( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TilerMosaicSearchRegistrationResponse] = kwargs.pop("cls", None) - - if body is _Unset: - body = { - "bbox": bounding_box, - "collections": collections, - "datetime_property": datetime, - "filter": filter, - "filter_lang": filter_language, - "ids": ids, - "intersects": intersects, - "metadata": metadata, - "query": query, - "sortby": sort_by, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_register_mosaics_search_request( - content_type=content_type, + _request = build_data_get_searches_tile_no_tms_by_scale_request( + search_id=search_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10586,7 +28890,8 @@ async def register_mosaics_search( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10602,40 +28907,55 @@ async def register_mosaics_search( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerMosaicSearchRegistrationResponse, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_mosaics_tile_json( # pylint: disable=too-many-locals + async def get_searches_tile_no_tms_by_scale_and_format( # pylint: disable=name-too-long,too-many-locals self, search_id: str, - tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - buffer: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, @@ -10644,67 +28964,97 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> _models.TileJsonMetadata: - """TileJson Tilematrixsetid As Path. + ) -> AsyncIterator[bytes]: + """Searches Tile. - Return TileJSON document for a searchId. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). - Default value is None. + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword tile_format: Default will be automatically defined if the output image needs a mask - (png) or - not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. Output **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str @@ -10714,7 +29064,8 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", - "lowest", "mean", "median", "stdev", "lastbandlow", and "lastbandhigh". Default value is None. + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. @@ -10748,15 +29099,22 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10770,28 +29128,37 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_tile_json_request( + _request = build_data_get_searches_tile_no_tms_by_scale_and_format_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, - min_zoom=min_zoom, - max_zoom=max_zoom, - tile_format=tile_format, - tile_scale=tile_scale, + tile_matrix_set_id=tile_matrix_set_id, buffer=buffer, color_formula=color_formula, collection=collection, @@ -10801,6 +29168,7 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + padding=padding, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10810,7 +29178,8 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10826,59 +29195,51 @@ async def get_mosaics_tile_json( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_mosaics_tile( # pylint: disable=too-many-locals + async def get_searches_assets_for_tile_no_tms( # pylint: disable=too-many-locals self, search_id: str, - tile_matrix_set_id: str, z: float, x: float, y: float, - scale: float, - format: str, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - buffer: Optional[str] = None, - color_formula: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, collection: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Tile Tilematrixsetid As Path. + ) -> List[Any]: + """Searches Assets For Tile. - Create map tile. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile. Required. :type z: float @@ -10888,101 +29249,221 @@ async def get_mosaics_tile( # pylint: disable=too-many-locals :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix. Required. :type y: float - :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. - :type scale: float - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_assets_for_tile_no_tms_request( + search_id=search_id, + z=z, + x=x, + y=y, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + tile_matrix_set_id=tile_matrix_set_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_searches_point( # pylint: disable=too-many-locals + self, + search_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any + ) -> _models.TilerCoreModelsResponsesPoint: + """Searches Point. + + Get Point value for a search dataset. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword collection: STAC Collection ID. Default value is None. + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. :paramtype collection: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", - "lowest", "mean", "median", "stdev", "lastbandlow", and "lastbandhigh". Default value is None. - :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10996,38 +29477,34 @@ async def get_mosaics_tile( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_tile_request( + _request = build_data_get_searches_point_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, - z=z, - x=x, - y=y, - scale=scale, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, + longitude=longitude, + latitude=latitude, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, - algorithm=algorithm, - algorithm_params=algorithm_params, - buffer=buffer, - color_formula=color_formula, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, collection=collection, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + coordinate_reference_system=coordinate_reference_system, resampling=resampling, - pixel_selection=pixel_selection, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11037,7 +29514,8 @@ async def get_mosaics_tile( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -11053,137 +29531,87 @@ async def get_mosaics_tile( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals + async def get_searches_point_with_assets( # pylint: disable=too-many-locals self, search_id: str, - tile_matrix_set_id: str, + longitude: float, + latitude: float, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, - color_formula: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Wmts Tilematrixsetid As Path. + ) -> List[_models.StacItemPointAsset]: + """Searches Point Assets. - OGC WMTS endpoint. + Return a list of assets for a given point in a search. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", - "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of StacItemPointAsset + :rtype: list[~azure.planetarycomputer.models.StacItemPointAsset] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11197,30 +29625,25 @@ async def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.StacItemPointAsset]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_wmts_capabilities_request( + _request = build_data_get_searches_point_with_assets_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - tile_format=tile_format, - tile_scale=tile_scale, - min_zoom=min_zoom, - max_zoom=max_zoom, - buffer=buffer, - color_formula=color_formula, - resampling=resampling, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, + longitude=longitude, + latitude=latitude, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11230,7 +29653,8 @@ async def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -11246,25 +29670,25 @@ async def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.StacItemPointAsset], response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore -class SharedAccessSignatureOperations: +class SasOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.planetarycomputer.aio.PlanetaryComputerProClient`'s - :attr:`shared_access_signature` attribute. + :attr:`sas` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11308,7 +29732,7 @@ async def get_sign( cls: ClsType[_models.SharedAccessSignatureSignedLink] = kwargs.pop("cls", None) - _request = build_shared_access_signature_get_sign_request( + _request = build_sas_get_sign_request( href=href, duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, @@ -11320,6 +29744,7 @@ async def get_sign( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11337,7 +29762,7 @@ async def get_sign( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SharedAccessSignatureSignedLink, response.json()) @@ -11379,7 +29804,7 @@ async def get_token( cls: ClsType[_models.SharedAccessSignatureToken] = kwargs.pop("cls", None) - _request = build_shared_access_signature_get_token_request( + _request = build_sas_get_token_request( collection_id=collection_id, duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, @@ -11391,6 +29816,7 @@ async def get_token( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11408,7 +29834,7 @@ async def get_token( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SharedAccessSignatureToken, response.json()) @@ -11444,7 +29870,7 @@ async def revoke_token(self, *, duration_in_minutes: Optional[int] = None, **kwa cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_shared_access_signature_revoke_token_request( + _request = build_sas_revoke_token_request( duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, headers=_headers, diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/__init__.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/__init__.py index 54cc3911b1f2..3cb3e9acdfcb 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/__init__.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/__init__.py @@ -23,8 +23,6 @@ ErrorInfo, Feature, Geometry, - ImageParameters, - ImageResponse, IngestionDefinition, IngestionRun, IngestionRunOperation, @@ -83,6 +81,12 @@ TileMatrix, TileMatrixSet, TileMatrixSetBoundingBox, + TileMatrixSetLimitsEntry, + TileSetBoundingBox, + TileSetEntry, + TileSetLink, + TileSetList, + TileSetMetadata, TileSettings, TilerAssetGeoJson, TilerCoreModelsResponsesPoint, @@ -113,6 +117,7 @@ PixelSelection, RenderOptionType, Resampling, + SelMethod, StacAssetUrlSigningMode, StacLinkType, StacModelType, @@ -121,7 +126,9 @@ TerrainAlgorithm, TileAddressingScheme, TileMatrixCornerOfOrigin, + TileMatrixSetId, TilerImageFormat, + WarpKernelResampling, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -137,8 +144,6 @@ "ErrorInfo", "Feature", "Geometry", - "ImageParameters", - "ImageResponse", "IngestionDefinition", "IngestionRun", "IngestionRunOperation", @@ -197,6 +202,12 @@ "TileMatrix", "TileMatrixSet", "TileMatrixSetBoundingBox", + "TileMatrixSetLimitsEntry", + "TileSetBoundingBox", + "TileSetEntry", + "TileSetLink", + "TileSetList", + "TileSetMetadata", "TileSettings", "TilerAssetGeoJson", "TilerCoreModelsResponsesPoint", @@ -224,6 +235,7 @@ "PixelSelection", "RenderOptionType", "Resampling", + "SelMethod", "StacAssetUrlSigningMode", "StacLinkType", "StacModelType", @@ -232,7 +244,9 @@ "TerrainAlgorithm", "TileAddressingScheme", "TileMatrixCornerOfOrigin", + "TileMatrixSetId", "TilerImageFormat", + "WarpKernelResampling", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_enums.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_enums.py index 7bc10699456d..20eb47245982 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_enums.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_enums.py @@ -445,6 +445,94 @@ class ColorMapNames(str, Enum, metaclass=CaseInsensitiveEnumMeta): """YlOrRd colormap - sequential white to dark red-orange.""" YLORRD_R = "ylorrd_r" """Reversed YlOrRd colormap.""" + ALGAE = "algae" + """Algae colormap - sequential green colormap for ocean data.""" + ALGAE_R = "algae_r" + """Reversed algae colormap.""" + AMP = "amp" + """Amp colormap - sequential magenta colormap for ocean data.""" + AMP_R = "amp_r" + """Reversed amp colormap.""" + BALANCE = "balance" + """Balance colormap - diverging blue to red for ocean data.""" + BALANCE_R = "balance_r" + """Reversed balance colormap.""" + CURL = "curl" + """Curl colormap - diverging teal to red for ocean data.""" + CURL_R = "curl_r" + """Reversed curl colormap.""" + DEEP = "deep" + """Deep colormap - sequential blue colormap for ocean data.""" + DEEP_R = "deep_r" + """Reversed deep colormap.""" + DELTA = "delta" + """Delta colormap - diverging blue to green for ocean data.""" + DELTA_R = "delta_r" + """Reversed delta colormap.""" + DENSE = "dense" + """Dense colormap - sequential purple colormap for ocean data.""" + DENSE_R = "dense_r" + """Reversed dense colormap.""" + DIFF = "diff" + """Diff colormap - diverging colormap for difference data.""" + DIFF_R = "diff_r" + """Reversed diff colormap.""" + HALINE = "haline" + """Haline colormap - sequential blue to yellow for salinity data.""" + HALINE_R = "haline_r" + """Reversed haline colormap.""" + ICE = "ice" + """Ice colormap - sequential blue colormap for ice data.""" + ICE_R = "ice_r" + """Reversed ice colormap.""" + MATTER = "matter" + """Matter colormap - sequential yellow to brown for ocean data.""" + MATTER_R = "matter_r" + """Reversed matter colormap.""" + OXY = "oxy" + """Oxy colormap - diverging colormap for oxygen data.""" + OXY_R = "oxy_r" + """Reversed oxy colormap.""" + PHASE = "phase" + """Phase colormap - circular colormap for phase data.""" + PHASE_R = "phase_r" + """Reversed phase colormap.""" + RAIN = "rain" + """Rain colormap - sequential colormap for precipitation data.""" + RAIN_R = "rain_r" + """Reversed rain colormap.""" + SOLAR = "solar" + """Solar colormap - sequential colormap for solar radiation data.""" + SOLAR_R = "solar_r" + """Reversed solar colormap.""" + SPEED = "speed" + """Speed colormap - sequential colormap for velocity data.""" + SPEED_R = "speed_r" + """Reversed speed colormap.""" + TARN = "tarn" + """Tarn colormap - sequential colormap for topographic data.""" + TARN_R = "tarn_r" + """Reversed tarn colormap.""" + TEMPO = "tempo" + """Tempo colormap - sequential colormap for temporal data.""" + TEMPO_R = "tempo_r" + """Reversed tempo colormap.""" + THERMAL = "thermal" + """Thermal colormap - sequential colormap for temperature data.""" + THERMAL_R = "thermal_r" + """Reversed thermal colormap.""" + TOPO = "topo" + """Topo colormap - sequential colormap for topographic data.""" + TOPO_R = "topo_r" + """Reversed topo colormap.""" + TURBID = "turbid" + """Turbid colormap - sequential colormap for turbidity data.""" + TURBID_R = "turbid_r" + """Reversed turbid colormap.""" + TURBO = "turbo" + """Turbo colormap - improved rainbow colormap.""" + TURBO_R = "turbo_r" + """Reversed turbo colormap.""" class FeatureType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -515,6 +603,8 @@ class IngestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STATIC_CATALOG = "StaticCatalog" """Static STAC Catalog.""" + STAC_GEOPARQUET = "StacGeoparquet" + """Ingestion STAC Geoparquet catalog.""" class LegendConfigType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -608,6 +698,8 @@ class PixelSelection(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Select image with lowest value in the last band.""" LAST_BAND_HIGH = "lastbandhigh" """Select image with highest value in the last band.""" + COUNT = "count" + """Count available pixels across sources.""" class RenderOptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -644,6 +736,27 @@ class Resampling(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Root mean square resampling - useful for resampling error or deviation grids.""" +class SelMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Xarray indexing method to use for inexact matches.""" + + NEAREST = "nearest" + """Nearest neighbor method.""" + LINEAR = "linear" + """Linear interpolation.""" + BILINEAR = "bilinear" + """Bilinear interpolation.""" + CUBIC = "cubic" + """Cubic interpolation.""" + CUBIC_SPLINE = "cubic_spline" + """Cubic spline interpolation.""" + LANCZOS = "lanczos" + """Lanczos interpolation.""" + AREA = "area" + """Area-weighted interpolation.""" + MODE = "mode" + """Mode (most common) value.""" + + class StacAssetUrlSigningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Represent the signature type for asset URLs.""" @@ -733,6 +846,26 @@ class TerrainAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Encodes elevation data in Mapbox Terrarium RGB format.""" TERRAINRGB = "terrainrgb" """Encodes elevation data in Mapbox TerrainRGB format.""" + SLOPE = "slope" + """Calculates slope from elevation data.""" + CAST = "cast" + """Casts data to a different type.""" + CEIL = "ceil" + """Rounds values up to the nearest integer.""" + FLOOR = "floor" + """Rounds values down to the nearest integer.""" + MIN = "min" + """Computes the minimum value across bands.""" + MAX = "max" + """Computes the maximum value across bands.""" + MEDIAN = "median" + """Computes the median value across bands.""" + MEAN = "mean" + """Computes the mean value across bands.""" + STD = "std" + """Computes the standard deviation across bands.""" + VAR = "var" + """Computes the variance across bands.""" class TileAddressingScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -755,6 +888,38 @@ class TileMatrixCornerOfOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Origin at the bottom-left corner (Y increases upward).""" +class TileMatrixSetId(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identifier selecting one of the TileMatrixSetId supported (default: + 'WebMercatorQuad') + + Standard identifier for a coordinate reference system and tiling scheme used for serving map + tiles. + """ + + CANADIAN_NAD83_LCC = "CanadianNAD83_LCC" + """Canadian NAD83 Lambert Conformal Conic projection tile matrix set.""" + EUROPEAN_ETRS89_LAEAQUAD = "EuropeanETRS89_LAEAQuad" + """European ETRS89 Lambert Azimuthal Equal Area Quad tile matrix set.""" + LINZ_ANTARTICA_MAP_TILEGRID = "LINZAntarticaMapTilegrid" + """Land Information New Zealand (LINZ) Antarctica Map tile grid matrix set.""" + NZTM2000_QUAD = "NZTM2000Quad" + """New Zealand Transverse Mercator 2000 Quad tile matrix set.""" + UPS_ANTARCTIC_WGS84_QUAD = "UPSAntarcticWGS84Quad" + """Universal Polar Stereographic Antarctic WGS84 Quad tile matrix set.""" + UPS_ARCTIC_WGS84_QUAD = "UPSArcticWGS84Quad" + """Universal Polar Stereographic Arctic WGS84 Quad tile matrix set.""" + UTM31_WGS84_QUAD = "UTM31WGS84Quad" + """Universal Transverse Mercator Zone 31 WGS84 Quad tile matrix set.""" + WGS1984_QUAD = "WGS1984Quad" + """WGS 1984 Quad tile matrix set.""" + WEB_MERCATOR_QUAD = "WebMercatorQuad" + """Web Mercator Quad tile matrix set.""" + WORLD_CRS84_QUAD = "WorldCRS84Quad" + """World CRS84 Quad tile matrix set.""" + WORLD_MERCATOR_WGS84_QUAD = "WorldMercatorWGS84Quad" + """World Mercator WGS84 Quad tile matrix set.""" + + class TilerImageFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Image format specifier for tile and image requests.""" @@ -774,3 +939,36 @@ class TilerImageFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """WebP format - modern image format with good compression.""" PNGRAW = "pngraw" """Raw PNG format for access to unprocessed data.""" + + +class WarpKernelResampling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """WarpKernel resampling algorithm used when doing re-projection. Defaults to ``nearest``.""" + + NEAREST = "nearest" + """Nearest neighbor.""" + BILINEAR = "bilinear" + """Bilinear interpolation.""" + CUBIC = "cubic" + """Cubic interpolation.""" + CUBIC_SPLINE = "cubic_spline" + """Cubic spline interpolation.""" + LANCZOS = "lanczos" + """Lanczos windowed sinc resampling.""" + AVERAGE = "average" + """Average resampling.""" + MODE = "mode" + """Mode resampling.""" + MAX = "max" + """Maximum value resampling.""" + MIN = "min" + """Minimum value resampling.""" + MED = "med" + """Median value resampling.""" + Q1 = "q1" + """First quartile resampling.""" + Q3 = "q3" + """Third quartile resampling.""" + SUM = "sum" + """Sum resampling.""" + RMS = "rms" + """Root mean square resampling.""" diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_models.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_models.py index 840671abaf7d..bc503bfe31f7 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_models.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/models/_models.py @@ -335,112 +335,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageParameters(_Model): - """Parameters for requesting a rendered image from a collection. - - :ivar cql: Cql. Required. - :vartype cql: dict[str, any] - :ivar zoom: Zoom. - :vartype zoom: float - :ivar geometry: Geometry. - :vartype geometry: ~azure.planetarycomputer.models.Geometry - :ivar render_parameters: JSON-encoded visualization parameters. Required. - :vartype render_parameters: str - :ivar columns: Width of the output image in pixels. Required. - :vartype columns: int - :ivar rows: Height of the output image in pixels. Required. - :vartype rows: int - :ivar show_branding: Whether to include branding on the output image. - :vartype show_branding: bool - :ivar image_size: Image size. - :vartype image_size: str - """ - - cql: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cql. Required.""" - zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Zoom.""" - geometry: Optional["_models.Geometry"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Geometry.""" - render_parameters: str = rest_field( - name="render_params", visibility=["read", "create", "update", "delete", "query"] - ) - """JSON-encoded visualization parameters. Required.""" - columns: int = rest_field(name="cols", visibility=["read", "create", "update", "delete", "query"]) - """Width of the output image in pixels. Required.""" - rows: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Height of the output image in pixels. Required.""" - show_branding: Optional[bool] = rest_field( - name="showBranding", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether to include branding on the output image.""" - image_size: Optional[str] = rest_field(name="imageSize", visibility=["read", "create", "update", "delete", "query"]) - """Image size.""" - - @overload - def __init__( - self, - *, - cql: dict[str, Any], - render_parameters: str, - columns: int, - rows: int, - zoom: Optional[float] = None, - geometry: Optional["_models.Geometry"] = None, - show_branding: Optional[bool] = None, - image_size: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImageResponse(_Model): - """Response model for image exports. - - :ivar url: URL of the exported image. Required. - :vartype url: str - """ - - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URL of the exported image. Required.""" - - @overload - def __init__( - self, - *, - url: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class IngestionDefinition(_Model): """Microsoft Planetary Computer Pro geo-catalog ingestion creation model. :ivar id: Ingestion id. Required. :vartype id: str - :ivar import_type: Ingestion type. Required. "StaticCatalog" + :ivar import_type: Ingestion type. Required. Known values are: "StaticCatalog" and + "StacGeoparquet". :vartype import_type: str or ~azure.planetarycomputer.models.IngestionType :ivar display_name: Ingestion name. :vartype display_name: str :ivar source_catalog_url: Source catalog URL. Required for StaticCatalog ingestion type. :vartype source_catalog_url: str + :ivar stac_geoparquet_url: Parquet catalog URL. Required for StacGeoparquet ingestion type. + :vartype stac_geoparquet_url: str :ivar skip_existing_items: Skip processing existing items in the catalog. :vartype skip_existing_items: bool :ivar keep_original_assets: Keep original source assets. @@ -456,7 +364,7 @@ class IngestionDefinition(_Model): import_type: Union[str, "_models.IngestionType"] = rest_field( name="importType", visibility=["read", "create", "update"] ) - """Ingestion type. Required. \"StaticCatalog\"""" + """Ingestion type. Required. Known values are: \"StaticCatalog\" and \"StacGeoparquet\".""" display_name: Optional[str] = rest_field( name="displayName", visibility=["read", "create", "update", "delete", "query"] ) @@ -465,6 +373,10 @@ class IngestionDefinition(_Model): name="sourceCatalogUrl", visibility=["read", "create", "update", "delete", "query"] ) """Source catalog URL. Required for StaticCatalog ingestion type.""" + stac_geoparquet_url: Optional[str] = rest_field( + name="stacGeoparquetUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Parquet catalog URL. Required for StacGeoparquet ingestion type.""" skip_existing_items: Optional[bool] = rest_field( name="skipExistingItems", visibility=["read", "create", "update", "delete", "query"] ) @@ -485,6 +397,7 @@ def __init__( import_type: Union[str, "_models.IngestionType"], display_name: Optional[str] = None, source_catalog_url: Optional[str] = None, + stac_geoparquet_url: Optional[str] = None, skip_existing_items: Optional[bool] = None, keep_original_assets: Optional[bool] = None, ) -> None: ... @@ -3700,6 +3613,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class TileMatrixSetLimitsEntry(_Model): + """Limits for a specific tile matrix within a tileset, defining the valid row/column range. + + :ivar tile_matrix: Identifier of the tile matrix level. Required. + :vartype tile_matrix: str + :ivar min_tile_row: Minimum tile row index at this zoom level. Required. + :vartype min_tile_row: int + :ivar max_tile_row: Maximum tile row index at this zoom level. Required. + :vartype max_tile_row: int + :ivar min_tile_col: Minimum tile column index at this zoom level. Required. + :vartype min_tile_col: int + :ivar max_tile_col: Maximum tile column index at this zoom level. Required. + :vartype max_tile_col: int + """ + + tile_matrix: str = rest_field(name="tileMatrix", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the tile matrix level. Required.""" + min_tile_row: int = rest_field(name="minTileRow", visibility=["read", "create", "update", "delete", "query"]) + """Minimum tile row index at this zoom level. Required.""" + max_tile_row: int = rest_field(name="maxTileRow", visibility=["read", "create", "update", "delete", "query"]) + """Maximum tile row index at this zoom level. Required.""" + min_tile_col: int = rest_field(name="minTileCol", visibility=["read", "create", "update", "delete", "query"]) + """Minimum tile column index at this zoom level. Required.""" + max_tile_col: int = rest_field(name="maxTileCol", visibility=["read", "create", "update", "delete", "query"]) + """Maximum tile column index at this zoom level. Required.""" + + @overload + def __init__( + self, + *, + tile_matrix: str, + min_tile_row: int, + max_tile_row: int, + min_tile_col: int, + max_tile_col: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class TilerAssetGeoJson(_Model): """Represents GeoJSON with feature with an asset property. @@ -3914,7 +3875,7 @@ class TilerInfoGeoJsonFeature(_Model): :ivar id: Unique identifier for the feature. :vartype id: str :ivar bounding_box: Bounding box coordinates for the feature. - :vartype bounding_box: float + :vartype bounding_box: list[float] """ type: Union[str, "_models.FeatureType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3925,7 +3886,9 @@ class TilerInfoGeoJsonFeature(_Model): """Properties. Required.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Unique identifier for the feature.""" - bounding_box: Optional[float] = rest_field(name="bbox", visibility=["read", "create", "update", "delete", "query"]) + bounding_box: Optional[list[float]] = rest_field( + name="bbox", visibility=["read", "create", "update", "delete", "query"] + ) """Bounding box coordinates for the feature.""" @overload @@ -3936,7 +3899,7 @@ def __init__( geometry: "_models.Geometry", properties: dict[str, "_models.TilerInfo"], id: Optional[str] = None, # pylint: disable=redefined-builtin - bounding_box: Optional[float] = None, + bounding_box: Optional[list[float]] = None, ) -> None: ... @overload @@ -4002,10 +3965,6 @@ class TilerStacSearchDefinition(_Model): :vartype hash: str :ivar search: Search. Required. :vartype search: dict[str, any] - :ivar where: SQL WHERE clause representing the search filters. Required. - :vartype where: str - :ivar order_by: SQL ORDER BY clause for sorting results. Required. - :vartype order_by: str :ivar last_used: Timestamp when the search was last accessed. Required. :vartype last_used: ~datetime.datetime :ivar use_count: Number of times the search has been accessed. Required. @@ -4018,10 +3977,6 @@ class TilerStacSearchDefinition(_Model): """Unique hash identifier for the search query. Required.""" search: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Search. Required.""" - where: str = rest_field(name="_where", visibility=["read", "create", "update", "delete", "query"]) - """SQL WHERE clause representing the search filters. Required.""" - order_by: str = rest_field(name="orderby", visibility=["read", "create", "update", "delete", "query"]) - """SQL ORDER BY clause for sorting results. Required.""" last_used: datetime.datetime = rest_field( name="lastused", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) @@ -4037,8 +3992,6 @@ def __init__( *, hash: str, search: dict[str, Any], - where: str, - order_by: str, last_used: datetime.datetime, use_count: int, metadata: "_models.MosaicMetadata", @@ -4096,6 +4049,240 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class TileSetBoundingBox(_Model): + """Bounding box for a tile set. + + :ivar lower_left: Lower-left corner coordinates [x, y]. Required. + :vartype lower_left: list[float] + :ivar upper_right: Upper-right corner coordinates [x, y]. Required. + :vartype upper_right: list[float] + :ivar crs: Coordinate reference system identifier. + :vartype crs: str + """ + + lower_left: list[float] = rest_field(name="lowerLeft", visibility=["read", "create", "update", "delete", "query"]) + """Lower-left corner coordinates [x, y]. Required.""" + upper_right: list[float] = rest_field(name="upperRight", visibility=["read", "create", "update", "delete", "query"]) + """Upper-right corner coordinates [x, y]. Required.""" + crs: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Coordinate reference system identifier.""" + + @overload + def __init__( + self, + *, + lower_left: list[float], + upper_right: list[float], + crs: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TileSetEntry(_Model): + """Summary information about a single tileset within a list of available tilesets. + + :ivar title: Human-readable title of the tileset. + :vartype title: str + :ivar data_type: Type of data in the tiles (e.g., 'map', 'vector'). + :vartype data_type: str + :ivar crs: Coordinate reference system identifier. + :vartype crs: str + :ivar links: Links related to this tileset. + :vartype links: list[~azure.planetarycomputer.models.TileSetLink] + :ivar bounding_box: Bounding box of the tileset. + :vartype bounding_box: ~azure.planetarycomputer.models.TileSetBoundingBox + :ivar access_constraints: Access constraints for the tileset. + :vartype access_constraints: str + """ + + title: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable title of the tileset.""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read", "create", "update", "delete", "query"]) + """Type of data in the tiles (e.g., 'map', 'vector').""" + crs: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Coordinate reference system identifier.""" + links: Optional[list["_models.TileSetLink"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Links related to this tileset.""" + bounding_box: Optional["_models.TileSetBoundingBox"] = rest_field( + name="boundingBox", visibility=["read", "create", "update", "delete", "query"] + ) + """Bounding box of the tileset.""" + access_constraints: Optional[str] = rest_field( + name="accessConstraints", visibility=["read", "create", "update", "delete", "query"] + ) + """Access constraints for the tileset.""" + + @overload + def __init__( + self, + *, + title: Optional[str] = None, + data_type: Optional[str] = None, + crs: Optional[str] = None, + links: Optional[list["_models.TileSetLink"]] = None, + bounding_box: Optional["_models.TileSetBoundingBox"] = None, + access_constraints: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TileSetLink(_Model): + """A link object used in OGC tile resources. + + :ivar href: The URL target of the link. Required. + :vartype href: str + :ivar rel: The relationship type of the link. Required. + :vartype rel: str + :ivar type: The media type of the linked resource. + :vartype type: str + :ivar title: Human-readable title of the link. + :vartype title: str + """ + + href: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL target of the link. Required.""" + rel: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The relationship type of the link. Required.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The media type of the linked resource.""" + title: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable title of the link.""" + + @overload + def __init__( + self, + *, + href: str, + rel: str, + type: Optional[str] = None, + title: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TileSetList(_Model): + """Response containing a list of available tilesets. + + :ivar tilesets: Array of available tilesets. Required. + :vartype tilesets: list[~azure.planetarycomputer.models.TileSetEntry] + """ + + tilesets: list["_models.TileSetEntry"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Array of available tilesets. Required.""" + + @overload + def __init__( + self, + *, + tilesets: list["_models.TileSetEntry"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TileSetMetadata(_Model): + """Detailed metadata about a specific tileset, including tile matrix set limits. + + :ivar title: Human-readable title of the tileset. + :vartype title: str + :ivar data_type: Type of data in the tiles. + :vartype data_type: str + :ivar crs: Coordinate reference system identifier. + :vartype crs: str + :ivar links: Links related to this tileset. + :vartype links: list[~azure.planetarycomputer.models.TileSetLink] + :ivar bounding_box: Bounding box of the tileset. + :vartype bounding_box: ~azure.planetarycomputer.models.TileSetBoundingBox + :ivar access_constraints: Access constraints for the tileset. + :vartype access_constraints: str + :ivar tile_matrix_set_limits: Limits for each tile matrix level in the tileset. + :vartype tile_matrix_set_limits: list[~azure.planetarycomputer.models.TileMatrixSetLimitsEntry] + """ + + title: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Human-readable title of the tileset.""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read", "create", "update", "delete", "query"]) + """Type of data in the tiles.""" + crs: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Coordinate reference system identifier.""" + links: Optional[list["_models.TileSetLink"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Links related to this tileset.""" + bounding_box: Optional["_models.TileSetBoundingBox"] = rest_field( + name="boundingBox", visibility=["read", "create", "update", "delete", "query"] + ) + """Bounding box of the tileset.""" + access_constraints: Optional[str] = rest_field( + name="accessConstraints", visibility=["read", "create", "update", "delete", "query"] + ) + """Access constraints for the tileset.""" + tile_matrix_set_limits: Optional[list["_models.TileMatrixSetLimitsEntry"]] = rest_field( + name="tileMatrixSetLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """Limits for each tile matrix level in the tileset.""" + + @overload + def __init__( + self, + *, + title: Optional[str] = None, + data_type: Optional[str] = None, + crs: Optional[str] = None, + links: Optional[list["_models.TileSetLink"]] = None, + bounding_box: Optional["_models.TileSetBoundingBox"] = None, + access_constraints: Optional[str] = None, + tile_matrix_set_limits: Optional[list["_models.TileMatrixSetLimitsEntry"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class TileSettings(_Model): """Configuration for map tile visualization. diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/__init__.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/__init__.py index 8ebab4777f3c..77959284ac2c 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/__init__.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/__init__.py @@ -15,7 +15,7 @@ from ._operations import IngestionOperations # type: ignore from ._operations import StacOperations # type: ignore from ._operations import DataOperations # type: ignore -from ._operations import SharedAccessSignatureOperations # type: ignore +from ._operations import SasOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -25,7 +25,7 @@ "IngestionOperations", "StacOperations", "DataOperations", - "SharedAccessSignatureOperations", + "SasOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py index 682ae83d26a2..55fba35d4ab4 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from collections.abc import MutableMapping # pylint: disable=import-error +from collections.abc import MutableMapping from io import IOBase import json from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload @@ -33,8 +33,7 @@ from .. import models as _models from .._configuration import PlanetaryComputerProClientConfiguration -from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _deserialize_xml # pylint: disable=unused-import - # pylint: disable=unused-import +from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _deserialize_xml from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prepare_multipart_form_data @@ -51,7 +50,7 @@ def build_ingestion_cancel_operation_request(operation_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/inma/operations/{operationId}" path_format_arguments = { @@ -69,7 +68,7 @@ def build_ingestion_cancel_operation_request(operation_id: str, **kwargs: Any) - def build_ingestion_cancel_all_operations_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/inma/operations" @@ -83,7 +82,7 @@ def build_ingestion_get_operation_request(operation_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +113,7 @@ def build_ingestion_list_operations_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +140,7 @@ def build_ingestion_create_run_request(collection_id: str, ingestion_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +165,7 @@ def build_ingestion_get_run_request(collection_id: str, ingestion_id: str, run_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +193,7 @@ def build_ingestion_list_runs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +223,7 @@ def build_ingestion_create_request(collection_id: str, **kwargs: Any) -> HttpReq _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +249,7 @@ def build_ingestion_delete_request(collection_id: str, ingestion_id: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -275,7 +274,7 @@ def build_ingestion_get_request(collection_id: str, ingestion_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -302,7 +301,7 @@ def build_ingestion_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -331,7 +330,7 @@ def build_ingestion_update_request(collection_id: str, ingestion_id: str, **kwar _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -359,7 +358,7 @@ def build_ingestion_create_source_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -381,7 +380,7 @@ def build_ingestion_replace_source_request(id: str, **kwargs: Any) -> HttpReques _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -406,7 +405,7 @@ def build_ingestion_replace_source_request(id: str, **kwargs: Any) -> HttpReques def build_ingestion_delete_source_request(id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/inma/ingestion-sources/{id}" path_format_arguments = { @@ -425,7 +424,7 @@ def build_ingestion_get_source_request(id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -451,7 +450,7 @@ def build_ingestion_list_sources_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -474,7 +473,7 @@ def build_ingestion_list_managed_identities_request(**kwargs: Any) -> HttpReques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -495,7 +494,7 @@ def build_stac_create_collection_asset_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -521,7 +520,7 @@ def build_stac_replace_collection_asset_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -548,7 +547,7 @@ def build_stac_delete_collection_asset_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -575,7 +574,7 @@ def build_stac_get_collection_configuration_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -600,7 +599,7 @@ def build_stac_add_mosaic_request(collection_id: str, **kwargs: Any) -> HttpRequ _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -627,7 +626,7 @@ def build_stac_replace_mosaic_request(collection_id: str, mosaic_id: str, **kwar _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -653,7 +652,7 @@ def build_stac_replace_mosaic_request(collection_id: str, mosaic_id: str, **kwar def build_stac_delete_mosaic_request(collection_id: str, mosaic_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/stac/collections/{collectionId}/configurations/mosaics/{mosaicId}" path_format_arguments = { @@ -673,7 +672,7 @@ def build_stac_get_mosaic_request(collection_id: str, mosaic_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -698,7 +697,7 @@ def build_stac_list_mosaics_request(collection_id: str, **kwargs: Any) -> HttpRe _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -723,7 +722,7 @@ def build_stac_create_collection_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -740,14 +739,12 @@ def build_stac_create_collection_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_stac_create_or_replace_collection_request( # pylint: disable=name-too-long - collection_id: str, **kwargs: Any -) -> HttpRequest: +def build_stac_replace_collection_request(collection_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -773,7 +770,7 @@ def build_stac_delete_collection_request(collection_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -803,7 +800,7 @@ def build_stac_get_collection_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -836,7 +833,7 @@ def build_stac_get_collections_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -859,7 +856,7 @@ def build_stac_get_partition_type_request(collection_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -886,7 +883,7 @@ def build_stac_replace_partition_type_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/stac/collections/{collectionId}/configurations/partition-type" path_format_arguments = { @@ -910,7 +907,7 @@ def build_stac_create_render_option_request(collection_id: str, **kwargs: Any) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -937,7 +934,7 @@ def build_stac_replace_render_option_request(collection_id: str, render_option_i _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -963,7 +960,7 @@ def build_stac_replace_render_option_request(collection_id: str, render_option_i def build_stac_delete_render_option_request(collection_id: str, render_option_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/stac/collections/{collectionId}/configurations/render-options/{renderOptionId}" path_format_arguments = { @@ -983,7 +980,7 @@ def build_stac_get_render_option_request(collection_id: str, render_option_id: s _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1008,7 +1005,7 @@ def build_stac_list_render_options_request(collection_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1034,7 +1031,7 @@ def build_stac_get_collection_thumbnail_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL @@ -1059,7 +1056,7 @@ def build_stac_get_tile_settings_request(collection_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1084,7 +1081,7 @@ def build_stac_replace_tile_settings_request(collection_id: str, **kwargs: Any) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1110,7 +1107,7 @@ def build_stac_get_conformance_class_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1129,7 +1126,7 @@ def build_stac_get_landing_page_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1149,7 +1146,7 @@ def build_stac_create_item_request(collection_id: str, **kwargs: Any) -> HttpReq _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1171,14 +1168,12 @@ def build_stac_create_item_request(collection_id: str, **kwargs: Any) -> HttpReq return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_stac_create_or_replace_item_request( # pylint: disable=name-too-long - collection_id: str, item_id: str, **kwargs: Any -) -> HttpRequest: +def build_stac_replace_item_request(collection_id: str, item_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1205,7 +1200,7 @@ def build_stac_delete_item_request(collection_id: str, item_id: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1226,11 +1221,18 @@ def build_stac_delete_item_request(collection_id: str, item_id: str, **kwargs: A return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_stac_get_item_request(collection_id: str, item_id: str, **kwargs: Any) -> HttpRequest: +def build_stac_get_item_request( + collection_id: str, + item_id: str, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1244,6 +1246,10 @@ def build_stac_get_item_request(collection_id: str, item_id: str, **kwargs: Any) # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if sign is not None: + _params["sign"] = _SERIALIZER.query("sign", sign, "str") + if duration_in_minutes is not None: + _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1257,12 +1263,15 @@ def build_stac_get_item_collection_request( limit: Optional[int] = None, bounding_box: Optional[List[str]] = None, datetime: Optional[str] = None, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1281,6 +1290,12 @@ def build_stac_get_item_collection_request( _params["bbox"] = _SERIALIZER.query("bounding_box", bounding_box, "[str]", div=",") if datetime is not None: _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sign is not None: + _params["sign"] = _SERIALIZER.query("sign", sign, "str") + if duration_in_minutes is not None: + _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + if token is not None: + _params["token"] = _SERIALIZER.query("token", token, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1293,7 +1308,7 @@ def build_stac_update_item_request(collection_id: str, item_id: str, **kwargs: A _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1321,7 +1336,7 @@ def build_stac_create_queryables_request(collection_id: str, **kwargs: Any) -> H _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1348,7 +1363,7 @@ def build_stac_replace_queryable_request(collection_id: str, queryable_name: str _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1374,7 +1389,7 @@ def build_stac_replace_queryable_request(collection_id: str, queryable_name: str def build_stac_delete_queryable_request(collection_id: str, queryable_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) # Construct URL _url = "/stac/collections/{collectionId}/queryables/{queryableName}" path_format_arguments = { @@ -1394,7 +1409,7 @@ def build_stac_list_queryables_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1415,7 +1430,7 @@ def build_stac_get_collection_queryables_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1445,7 +1460,7 @@ def build_stac_search_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1472,7 +1487,7 @@ def build_data_get_tile_matrix_definitions_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1496,7 +1511,7 @@ def build_data_list_tile_matrices_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1511,68 +1526,99 @@ def build_data_list_tile_matrices_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_asset_statistics_request( - collection_id: str, - item_id: str, +def build_data_get_class_map_legend_request( + classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/data/legend/classmap/{classmapName}" + path_format_arguments = { + "classmapName": _SERIALIZER.url("classmap_name", classmap_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if trim_start is not None: + _params["trim_start"] = _SERIALIZER.query("trim_start", trim_start, "int") + if trim_end is not None: + _params["trim_end"] = _SERIALIZER.query("trim_end", trim_end, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_get_interval_legend_request( + classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/data/legend/interval/{classmapName}" + path_format_arguments = { + "classmapName": _SERIALIZER.url("classmap_name", classmap_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if trim_start is not None: + _params["trim_start"] = _SERIALIZER.query("trim_start", trim_start, "int") + if trim_end is not None: + _params["trim_end"] = _SERIALIZER.query("trim_end", trim_end, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_get_legend_request( + color_map_name: str, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, + height: Optional[float] = None, + width: Optional[float] = None, + trim_start: Optional[int] = None, + trim_end: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "image/png") # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/asset_statistics" + _url = "/data/legend/colormap/{colorMapName}" path_format_arguments = { - "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), - "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "colorMapName": _SERIALIZER.url("color_map_name", color_map_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if assets is not None: - _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] - if expression is not None: - _params["expression"] = _SERIALIZER.query("expression", expression, "str") - if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") - if asset_as_band is not None: - _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") - if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") - if unscale is not None: - _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") - if resampling is not None: - _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if categorical is not None: - _params["categorical"] = _SERIALIZER.query("categorical", categorical, "bool") - if categories_pixels is not None: - _params["c"] = _SERIALIZER.query("categories_pixels", categories_pixels, "[str]", div=",") - if percentiles is not None: - _params["p"] = _SERIALIZER.query("percentiles", percentiles, "[int]", div=",") - if histogram_bins is not None: - _params["histogram_bins"] = _SERIALIZER.query("histogram_bins", histogram_bins, "str") - if histogram_range is not None: - _params["histogram_range"] = _SERIALIZER.query("histogram_range", histogram_range, "str") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "float") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "float") + if trim_start is not None: + _params["trim_start"] = _SERIALIZER.query("trim_start", trim_start, "int") + if trim_end is not None: + _params["trim_end"] = _SERIALIZER.query("trim_end", trim_end, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1580,15 +1626,49 @@ def build_data_get_asset_statistics_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_list_available_assets_request(collection_id: str, item_id: str, **kwargs: Any) -> HttpRequest: +def build_data_register_mosaics_search_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/data/mosaic/register" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_list_tilesets_request( + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/assets" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), @@ -1598,6 +1678,20 @@ def build_data_list_available_assets_request(collection_id: str, item_id: str, * # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1605,24 +1699,52 @@ def build_data_list_available_assets_request(collection_id: str, item_id: str, * return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_bounds_request(collection_id: str, item_id: str, **kwargs: Any) -> HttpRequest: +def build_data_get_tileset_metadata_request( + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/bounds" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{tileMatrixSetId}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1630,78 +1752,94 @@ def build_data_get_bounds_request(collection_id: str, item_id: str, **kwargs: An return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_crop_geo_json_request( # pylint: disable=too-many-locals +def build_data_get_tile_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, - format: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/crop.{format}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "format": _SERIALIZER.url("format", format, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if height is not None: - _params["height"] = _SERIALIZER.query("height", height, "int") - if width is not None: - _params["width"] = _SERIALIZER.query("width", width, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -1710,55 +1848,82 @@ def build_data_crop_geo_json_request( # pylint: disable=too-many-locals _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") if accept is not None: _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_crop_geo_json_with_dimensions_request( # pylint: disable=name-too-long,too-many-locals +def build_data_get_tile_by_format_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, - width: int, - height: int, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/crop/{width}x{height}.{format}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}.{format}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "width": _SERIALIZER.url("width", width, "int"), - "height": _SERIALIZER.url("height", height, "int"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), "format": _SERIALIZER.url("format", format, "str"), } @@ -1766,30 +1931,34 @@ def build_data_crop_geo_json_with_dimensions_request( # pylint: disable=name-to # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -1798,194 +1967,204 @@ def build_data_crop_geo_json_with_dimensions_request( # pylint: disable=name-to _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") if accept is not None: _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_geo_json_statistics_request( # pylint: disable=name-too-long +def build_data_get_tile_by_scale_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/statistics" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if categorical is not None: - _params["categorical"] = _SERIALIZER.query("categorical", categorical, "bool") - if categories_pixels is not None: - _params["c"] = _SERIALIZER.query("categories_pixels", categories_pixels, "[str]", div=",") - if percentiles is not None: - _params["p"] = _SERIALIZER.query("percentiles", percentiles, "[int]", div=",") - if histogram_bins is not None: - _params["histogram_bins"] = _SERIALIZER.query("histogram_bins", histogram_bins, "str") - if histogram_range is not None: - _params["histogram_range"] = _SERIALIZER.query("histogram_range", histogram_range, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_get_info_geo_json_request( - collection_id: str, item_id: str, *, assets: Optional[List[str]] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/info.geojson" - path_format_arguments = { - "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), - "itemId": _SERIALIZER.url("item_id", item_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if assets is not None: - _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_get_item_asset_details_request( # pylint: disable=name-too-long - collection_id: str, item_id: str, *, assets: Optional[List[str]] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/info" - path_format_arguments = { - "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), - "itemId": _SERIALIZER.url("item_id", item_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if assets is not None: - _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_part_request( # pylint: disable=too-many-locals +def build_data_get_tile_by_scale_and_format_request( # pylint: disable=name-too-long,too-many-locals collection_id: str, item_id: str, - minx: float, - miny: float, - maxx: float, - maxy: float, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/crop/{minx},{miny},{maxx},{maxy}.{format}" + _url = ( + "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x.{format}" + ) path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "minx": _SERIALIZER.url("minx", minx, "float"), - "miny": _SERIALIZER.url("miny", miny, "float"), - "maxx": _SERIALIZER.url("maxx", maxx, "float"), - "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), "format": _SERIALIZER.url("format", format, "str"), } @@ -1993,36 +2172,32 @@ def build_data_get_part_request( # pylint: disable=too-many-locals # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if dst_crs is not None: - _params["dst-crs"] = _SERIALIZER.query("dst_crs", dst_crs, "str") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if height is not None: - _params["height"] = _SERIALIZER.query("height", height, "int") - if width is not None: - _params["width"] = _SERIALIZER.query("width", width, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -2031,6 +2206,22 @@ def build_data_get_part_request( # pylint: disable=too-many-locals _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers if accept is not None: @@ -2039,86 +2230,95 @@ def build_data_get_part_request( # pylint: disable=too-many-locals return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_part_with_dimensions_request( # pylint: disable=name-too-long,too-many-locals +def build_data_get_tile_no_tms_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, - minx: float, - miny: float, - maxx: float, - maxy: float, - width: int, - height: int, - format: str, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/crop/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{z}/{x}/{y}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "minx": _SERIALIZER.url("minx", minx, "float"), - "miny": _SERIALIZER.url("miny", miny, "float"), - "maxx": _SERIALIZER.url("maxx", maxx, "float"), - "maxy": _SERIALIZER.url("maxy", maxy, "float"), - "width": _SERIALIZER.url("width", width, "int"), - "height": _SERIALIZER.url("height", height, "int"), - "format": _SERIALIZER.url("format", format, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if dst_crs is not None: - _params["dst-crs"] = _SERIALIZER.query("dst_crs", dst_crs, "str") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -2127,6 +2327,22 @@ def build_data_get_part_with_dimensions_request( # pylint: disable=name-too-lon _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers if accept is not None: @@ -2135,136 +2351,214 @@ def build_data_get_part_with_dimensions_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_point_request( +def build_data_get_tile_no_tms_by_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, - longitude: float, - latitude: float, + z: float, + x: float, + y: float, + format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/point/{longitude},{latitude}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{z}/{x}/{y}.{format}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "longitude": _SERIALIZER.url("longitude", longitude, "float"), - "latitude": _SERIALIZER.url("latitude", latitude, "float"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "format": _SERIALIZER.url("format", format, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_preview_request( # pylint: disable=too-many-locals +def build_data_get_tile_no_tms_by_scale_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, + z: float, + x: float, + y: float, + scale: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/preview" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{z}/{x}/{y}@{scale}x" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") if format is not None: _params["format"] = _SERIALIZER.query("format", format, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if dst_crs is not None: - _params["dst-crs"] = _SERIALIZER.query("dst_crs", dst_crs, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if height is not None: - _params["height"] = _SERIALIZER.query("height", height, "int") - if width is not None: - _params["width"] = _SERIALIZER.query("width", width, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -2273,6 +2567,22 @@ def build_data_get_preview_request( # pylint: disable=too-many-locals _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers if accept is not None: @@ -2281,42 +2591,58 @@ def build_data_get_preview_request( # pylint: disable=too-many-locals return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_preview_with_format_request( # pylint: disable=name-too-long,too-many-locals +def build_data_get_tile_no_tms_by_scale_and_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, + z: float, + x: float, + y: float, + scale: float, format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/preview.{format}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tiles/{z}/{x}/{y}@{scale}x.{format}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), "format": _SERIALIZER.url("format", format, "str"), } @@ -2324,34 +2650,34 @@ def build_data_get_preview_with_format_request( # pylint: disable=name-too-long # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if dst_crs is not None: - _params["dst-crs"] = _SERIALIZER.query("dst_crs", dst_crs, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if max_size is not None: - _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if height is not None: - _params["height"] = _SERIALIZER.query("height", height, "int") - if width is not None: - _params["width"] = _SERIALIZER.query("width", width, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -2360,6 +2686,22 @@ def build_data_get_preview_with_format_request( # pylint: disable=name-too-long _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers if accept is not None: @@ -2368,85 +2710,50 @@ def build_data_get_preview_with_format_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_create_static_image_request(collection_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/data/collections/{collectionId}/image/static" - path_format_arguments = { - "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_get_static_image_request(collection_id: str, id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "image/png") - - # Construct URL - _url = "/data/collections/{collectionId}/image/static/{id}" - path_format_arguments = { - "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), - "id": _SERIALIZER.url("id", id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_list_statistics_request( +def build_data_crop_feature_geo_json_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/statistics" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/feature" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), @@ -2456,113 +2763,160 @@ def build_data_list_statistics_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") if max_size is not None: _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") - if categorical is not None: - _params["categorical"] = _SERIALIZER.query("categorical", categorical, "bool") - if categories_pixels is not None: - _params["c"] = _SERIALIZER.query("categories_pixels", categories_pixels, "[str]", div=",") - if percentiles is not None: - _params["p"] = _SERIALIZER.query("percentiles", percentiles, "[int]", div=",") - if histogram_bins is not None: - _params["histogram_bins"] = _SERIALIZER.query("histogram_bins", histogram_bins, "str") - if histogram_range is not None: - _params["histogram_range"] = _SERIALIZER.query("histogram_range", histogram_range, "str") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_tile_json_request( # pylint: disable=too-many-locals +def build_data_crop_feature_geo_json_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, - tile_matrix_set_id: str, + format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/{tileMatrixSetId}/tilejson.json" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/feature.{format}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "format": _SERIALIZER.url("format", format, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") - if tile_format is not None: - _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") - if tile_scale is not None: - _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") - if min_zoom is not None: - _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") - if max_zoom is not None: - _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") - if buffer is not None: - _params["buffer"] = _SERIALIZER.query("buffer", buffer, "str") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -2571,58 +2925,81 @@ def build_data_get_tile_json_request( # pylint: disable=too-many-locals _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_tile_request( # pylint: disable=too-many-locals +def build_data_crop_feature_geo_json_width_by_height_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches collection_id: str, item_id: str, - tile_matrix_set_id: str, - z: float, - x: float, - y: float, - scale: float, + width: int, + height: int, format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - buffer: Optional[str] = None, color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, subdataset_name: Optional[str] = None, - subdataset_bands: Optional[List[str]] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", None) # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x.{format}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/feature/{width}x{height}.{format}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), - "z": _SERIALIZER.url("z", z, "float"), - "x": _SERIALIZER.url("x", x, "float"), - "y": _SERIALIZER.url("y", y, "float"), - "scale": _SERIALIZER.url("scale", scale, "float"), + "width": _SERIALIZER.url("width", width, "int"), + "height": _SERIALIZER.url("height", height, "int"), "format": _SERIALIZER.url("format", format, "str"), } @@ -2630,28 +3007,34 @@ def build_data_get_tile_request( # pylint: disable=too-many-locals # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") - if buffer is not None: - _params["buffer"] = _SERIALIZER.query("buffer", buffer, "str") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -2660,100 +3043,76 @@ def build_data_get_tile_request( # pylint: disable=too-many-locals _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") if subdataset_name is not None: _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") if subdataset_bands is not None: - _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[str]", div=",") + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") if accept is not None: _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_wmts_capabilities_request( # pylint: disable=too-many-locals +def build_data_get_item_bounds_request( collection_id: str, item_id: str, - tile_matrix_set_id: str, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, - color_formula: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/xml") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/collections/{collectionId}/items/{itemId}/{tileMatrixSetId}/WMTSCapabilities.xml" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/bounds" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), "itemId": _SERIALIZER.url("item_id", item_id, "str"), - "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if assets is not None: - _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] - if expression is not None: - _params["expression"] = _SERIALIZER.query("expression", expression, "str") - if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") - if asset_as_band is not None: - _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") - if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") - if unscale is not None: - _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") - if algorithm is not None: - _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") - if algorithm_params is not None: - _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") - if tile_format is not None: - _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") - if tile_scale is not None: - _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") - if min_zoom is not None: - _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") - if max_zoom is not None: - _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") - if buffer is not None: - _params["buffer"] = _SERIALIZER.query("buffer", buffer, "str") - if color_formula is not None: - _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if resampling is not None: - _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if rescale is not None: - _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] - if color_map_name is not None: - _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") - if color_map is not None: - _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") - if return_mask is not None: - _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2761,29 +3120,53 @@ def build_data_get_wmts_capabilities_request( # pylint: disable=too-many-locals return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_class_map_legend_request( - classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any +def build_data_get_item_info_request( + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + assets: Optional[List[str]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/legend/classmap/{classmapName}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/info" path_format_arguments = { - "classmapName": _SERIALIZER.url("classmap_name", classmap_name, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if trim_start is not None: - _params["trim_start"] = _SERIALIZER.query("trim_start", trim_start, "int") - if trim_end is not None: - _params["trim_end"] = _SERIALIZER.query("trim_end", trim_end, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2791,29 +3174,53 @@ def build_data_get_class_map_legend_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_interval_legend_request( - classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any +def build_data_get_item_info_geo_json_request( # pylint: disable=name-too-long + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + assets: Optional[List[str]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/legend/interval/{classmapName}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/info.geojson" path_format_arguments = { - "classmapName": _SERIALIZER.url("classmap_name", classmap_name, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if trim_start is not None: - _params["trim_start"] = _SERIALIZER.query("trim_start", trim_start, "int") - if trim_end is not None: - _params["trim_end"] = _SERIALIZER.query("trim_end", trim_end, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2821,39 +3228,50 @@ def build_data_get_interval_legend_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_legend_request( - color_map_name: str, +def build_data_list_item_available_assets_request( # pylint: disable=name-too-long + collection_id: str, + item_id: str, *, - height: Optional[float] = None, - width: Optional[float] = None, - trim_start: Optional[int] = None, - trim_end: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "image/png") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/legend/colormap/{colorMapName}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/assets" path_format_arguments = { - "colorMapName": _SERIALIZER.url("color_map_name", color_map_name, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if height is not None: - _params["height"] = _SERIALIZER.query("height", height, "float") - if width is not None: - _params["width"] = _SERIALIZER.query("width", width, "float") - if trim_start is not None: - _params["trim_start"] = _SERIALIZER.query("trim_start", trim_start, "int") - if trim_end is not None: - _params["trim_end"] = _SERIALIZER.query("trim_end", trim_end, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2861,49 +3279,98 @@ def build_data_get_legend_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_mosaics_assets_for_point_request( # pylint: disable=name-too-long - search_id: str, - longitude: float, - latitude: float, +def build_data_get_item_asset_statistics_request( # pylint: disable=name-too-long,too-many-locals + collection_id: str, + item_id: str, *, - scan_limit: Optional[int] = None, - items_limit: Optional[int] = None, - time_limit: Optional[int] = None, - exit_when_full: Optional[bool] = None, - skip_covered: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + asset_band_indices: Optional[List[str]] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + asset_expression: Optional[List[str]] = None, + height: Optional[int] = None, + width: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/mosaic/{searchId}/{longitude},{latitude}/assets" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/asset_statistics" path_format_arguments = { - "searchId": _SERIALIZER.url("search_id", search_id, "str"), - "longitude": _SERIALIZER.url("longitude", longitude, "float"), - "latitude": _SERIALIZER.url("latitude", latitude, "float"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if scan_limit is not None: - _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") - if items_limit is not None: - _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") - if time_limit is not None: - _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") - if exit_when_full is not None: - _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") - if skip_covered is not None: - _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") - if coordinate_reference_system is not None: - _params["coord-crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if categorical is not None: + _params["categorical"] = _SERIALIZER.query("categorical", categorical, "bool") + if categories_pixels is not None: + _params["c"] = _SERIALIZER.query("categories_pixels", categories_pixels, "[int]", div=",") + if percentiles is not None: + _params["p"] = _SERIALIZER.query("percentiles", percentiles, "[int]", div=",") + if histogram_bins is not None: + _params["histogram_bins"] = _SERIALIZER.query("histogram_bins", histogram_bins, "str") + if histogram_range is not None: + _params["histogram_range"] = _SERIALIZER.query("histogram_range", histogram_range, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if asset_expression is not None: + _params["asset_expression"] = _SERIALIZER.query("asset_expression", asset_expression, "[str]", div=",") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2911,52 +3378,107 @@ def build_data_get_mosaics_assets_for_point_request( # pylint: disable=name-too return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_mosaics_assets_for_tile_request( # pylint: disable=name-too-long - search_id: str, - tile_matrix_set_id: str, - z: float, - x: float, - y: float, - *, +def build_data_list_item_statistics_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches collection_id: str, - scan_limit: Optional[int] = None, - items_limit: Optional[int] = None, - time_limit: Optional[int] = None, - exit_when_full: Optional[bool] = None, - skip_covered: Optional[bool] = None, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/mosaic/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}/assets" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/statistics" path_format_arguments = { - "searchId": _SERIALIZER.url("search_id", search_id, "str"), - "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), - "z": _SERIALIZER.url("z", z, "float"), - "x": _SERIALIZER.url("x", x, "float"), - "y": _SERIALIZER.url("y", y, "float"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if scan_limit is not None: - _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") - if items_limit is not None: - _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") - if time_limit is not None: - _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") - if exit_when_full is not None: - _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") - if skip_covered is not None: - _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") - _params["collection"] = _SERIALIZER.query("collection_id", collection_id, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if categorical is not None: + _params["categorical"] = _SERIALIZER.query("categorical", categorical, "bool") + if categories_pixels is not None: + _params["c"] = _SERIALIZER.query("categories_pixels", categories_pixels, "[int]", div=",") + if percentiles is not None: + _params["p"] = _SERIALIZER.query("percentiles", percentiles, "[int]", div=",") + if histogram_bins is not None: + _params["histogram_bins"] = _SERIALIZER.query("histogram_bins", histogram_bins, "str") + if histogram_range is not None: + _params["histogram_range"] = _SERIALIZER.query("histogram_range", histogram_range, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -2964,45 +3486,114 @@ def build_data_get_mosaics_assets_for_tile_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_mosaics_search_info_request( # pylint: disable=name-too-long - search_id: str, **kwargs: Any +def build_data_get_item_geo_json_statistics_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/mosaic/{searchId}/info" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/statistics" path_format_arguments = { - "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_data_register_mosaics_search_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/data/mosaic/register" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if categorical is not None: + _params["categorical"] = _SERIALIZER.query("categorical", categorical, "bool") + if categories_pixels is not None: + _params["c"] = _SERIALIZER.query("categories_pixels", categories_pixels, "[int]", div=",") + if percentiles is not None: + _params["p"] = _SERIALIZER.query("percentiles", percentiles, "[int]", div=",") + if histogram_bins is not None: + _params["histogram_bins"] = _SERIALIZER.query("histogram_bins", histogram_bins, "str") + if histogram_range is not None: + _params["histogram_range"] = _SERIALIZER.query("histogram_range", histogram_range, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") # Construct headers if content_type is not None: @@ -3012,99 +3603,95 @@ def build_data_register_mosaics_search_request(**kwargs: Any) -> HttpRequest: # return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_mosaics_tile_json_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches - search_id: str, - tile_matrix_set_id: str, +def build_data_get_item_tile_json_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - scan_limit: Optional[int] = None, - items_limit: Optional[int] = None, - time_limit: Optional[int] = None, - exit_when_full: Optional[bool] = None, - skip_covered: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, tile_scale: Optional[int] = None, - buffer: Optional[str] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/mosaic/{searchId}/{tileMatrixSetId}/tilejson.json" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/tilejson.json" path_format_arguments = { - "searchId": _SERIALIZER.url("search_id", search_id, "str"), - "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") - if scan_limit is not None: - _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") - if items_limit is not None: - _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") - if time_limit is not None: - _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") - if exit_when_full is not None: - _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") - if skip_covered is not None: - _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") - if min_zoom is not None: - _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") - if max_zoom is not None: - _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") if tile_format is not None: _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") if tile_scale is not None: _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") if buffer is not None: - _params["buffer"] = _SERIALIZER.query("buffer", buffer, "str") + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if collection is not None: - _params["collection"] = _SERIALIZER.query("collection", collection, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if pixel_selection is not None: - _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -3113,6 +3700,22 @@ def build_data_get_mosaics_tile_json_request( # pylint: disable=too-many-locals _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3120,97 +3723,94 @@ def build_data_get_mosaics_tile_json_request( # pylint: disable=too-many-locals return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_mosaics_tile_request( # pylint: disable=too-many-locals,too-many-branches,too-many-statements - search_id: str, +def build_data_get_item_tile_json_tms_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, tile_matrix_set_id: str, - z: float, - x: float, - y: float, - scale: float, - format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - scan_limit: Optional[int] = None, - items_limit: Optional[int] = None, - time_limit: Optional[int] = None, - exit_when_full: Optional[bool] = None, - skip_covered: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - buffer: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/data/mosaic/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x.{format}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/{tileMatrixSetId}/tilejson.json" path_format_arguments = { - "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), - "z": _SERIALIZER.url("z", z, "float"), - "x": _SERIALIZER.url("x", x, "float"), - "y": _SERIALIZER.url("y", y, "float"), - "scale": _SERIALIZER.url("scale", scale, "float"), - "format": _SERIALIZER.url("format", format, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") - if scan_limit is not None: - _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") - if items_limit is not None: - _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") - if time_limit is not None: - _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") - if exit_when_full is not None: - _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") - if skip_covered is not None: - _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") if buffer is not None: - _params["buffer"] = _SERIALIZER.query("buffer", buffer, "str") + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") - if collection is not None: - _params["collection"] = _SERIALIZER.query("collection", collection, "str") if resampling is not None: _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - if pixel_selection is not None: - _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") if rescale is not None: _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] if color_map_name is not None: @@ -3219,72 +3819,104 @@ def build_data_get_mosaics_tile_request( # pylint: disable=too-many-locals,too- _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers - if accept is not None: - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_mosaics_wmts_capabilities_request( # pylint: disable=name-too-long,too-many-locals - search_id: str, - tile_matrix_set_id: str, +def build_data_get_item_wmts_capabilities_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, - buffer: Optional[str] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/xml") # Construct URL - _url = "/data/mosaic/{searchId}/{tileMatrixSetId}/WMTSCapabilities.xml" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/WMTSCapabilities.xml" path_format_arguments = { - "searchId": _SERIALIZER.url("search_id", search_id, "str"), - "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] if assets is not None: _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] if expression is not None: _params["expression"] = _SERIALIZER.query("expression", expression, "str") if asset_band_indices is not None: - _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "str") + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") if asset_as_band is not None: _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") if no_data is not None: - _params["nodata"] = _SERIALIZER.query("no_data", no_data, "float") + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") if unscale is not None: _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") if algorithm is not None: _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") if algorithm_params is not None: _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") if tile_format is not None: _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") if tile_scale is not None: @@ -3294,7 +3926,7 @@ def build_data_get_mosaics_wmts_capabilities_request( # pylint: disable=name-to if max_zoom is not None: _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") if buffer is not None: - _params["buffer"] = _SERIALIZER.query("buffer", buffer, "str") + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") if color_formula is not None: _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") if resampling is not None: @@ -3307,30 +3939,141 @@ def build_data_get_mosaics_wmts_capabilities_request( # pylint: disable=name-to _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") if return_mask is not None: _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") - + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_shared_access_signature_get_sign_request( # pylint: disable=name-too-long - *, href: str, duration_in_minutes: Optional[int] = None, **kwargs: Any +def build_data_get_item_wmts_capabilities_tms_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) - accept = _headers.pop("Accept", "application/json") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/xml") # Construct URL - _url = "/sas/sign" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/{tileMatrixSetId}/WMTSCapabilities.xml" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["href"] = _SERIALIZER.query("href", href, "str") - if duration_in_minutes is not None: - _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3338,27 +4081,84 @@ def build_shared_access_signature_get_sign_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_shared_access_signature_get_token_request( # pylint: disable=name-too-long - collection_id: str, *, duration_in_minutes: Optional[int] = None, **kwargs: Any +def build_data_get_item_point_request( # pylint: disable=too-many-locals + collection_id: str, + item_id: str, + longitude: float, + latitude: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/sas/token/{collectionId}" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/point/{longitude},{latitude}" path_format_arguments = { "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "longitude": _SERIALIZER.url("longitude", longitude, "float"), + "latitude": _SERIALIZER.url("latitude", latitude, "float"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if duration_in_minutes is not None: - _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3366,3040 +4166,6150 @@ def build_shared_access_signature_get_token_request( # pylint: disable=name-too return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_shared_access_signature_revoke_token_request( # pylint: disable=name-too-long - *, duration_in_minutes: Optional[int] = None, **kwargs: Any +def build_data_get_item_preview_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + color_formula: Optional[str] = None, + dst_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) + # Construct URL - _url = "/sas/token/revoke" + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/preview" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if duration_in_minutes is not None: - _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if dst_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("dst_crs", dst_crs, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class IngestionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s - :attr:`ingestion` attribute. - """ +def build_data_get_item_preview_with_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + dst_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PlanetaryComputerProClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - @distributed_trace - def cancel_operation( # pylint: disable=inconsistent-return-statements - self, operation_id: str, **kwargs: Any - ) -> None: - """Cancel a running operation of a geo-catalog collection. - - :param operation_id: Operation id. Required. - :type operation_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/preview.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "format": _SERIALIZER.url("format", format, "str"), + } - _request = build_ingestion_cancel_operation_request( - operation_id=operation_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if dst_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("dst_crs", dst_crs, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - response = pipeline_response.http_response + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace - def cancel_all_operations(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Cancel all running operations of a geo-catalog collection. +def build_data_get_item_bbox_crop_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/bbox/{minx},{miny},{maxx},{maxy}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - cls: ClsType[None] = kwargs.pop("cls", None) + _url: str = _url.format(**path_format_arguments) # type: ignore - _request = build_ingestion_cancel_all_operations_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - response = pipeline_response.http_response + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - if cls: - return cls(pipeline_response, None, {}) # type: ignore +def build_data_get_item_bbox_crop_with_dimensions_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + item_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace - def get_operation(self, operation_id: str, **kwargs: Any) -> _models.Operation: - """Get an operation of a geo-catalog collection. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - :param operation_id: Operation id. Required. - :type operation_id: str - :return: Operation. The Operation is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.Operation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Operation] = kwargs.pop("cls", None) - - _request = build_ingestion_get_operation_request( - operation_id=operation_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/items/{itemId}/bbox/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "itemId": _SERIALIZER.url("item_id", item_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "width": _SERIALIZER.url("width", width, "int"), + "height": _SERIALIZER.url("height", height, "int"), + "format": _SERIALIZER.url("format", format, "str"), + } - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + _url: str = _url.format(**path_format_arguments) # type: ignore - response = pipeline_response.http_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.Operation, response.json()) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized # type: ignore +def build_data_list_collection_tilesets_request( # pylint: disable=name-too-long + collection_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace - def list_operations( - self, - *, - top: Optional[int] = None, - skip: Optional[int] = None, - collection_id: Optional[str] = None, - status: Optional[Union[str, _models.OperationStatus]] = None, - **kwargs: Any - ) -> ItemPaged["_models.Operation"]: - """Get operations of a geo-catalog collection. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - :keyword top: The number of items to return. Default value is None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword collection_id: Operation id used to filter the results. Default value is None. - :paramtype collection_id: str - :keyword status: Operation status used to filter the results. Known values are: "Pending", - "Running", "Succeeded", "Canceled", "Canceling", and "Failed". Default value is None. - :paramtype status: str or ~azure.planetarycomputer.models.OperationStatus - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + } - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + _url: str = _url.format(**path_format_arguments) # type: ignore - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - def prepare_request(next_link=None): - if not next_link: + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _request = build_ingestion_list_operations_request( - top=top, - skip=skip, - collection_id=collection_id, - status=status, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request +def build_data_get_collection_tileset_metadata_request( # pylint: disable=name-too-long + collection_id: str, + tile_matrix_set_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - def get_next(next_link=None): - _request = prepare_request(next_link) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{tileMatrixSetId}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + _url: str = _url.format(**path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - return pipeline_response + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return ItemPaged(get_next, extract_data) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - @distributed_trace - def create_run(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> _models.IngestionRun: - """Create a new run of an ingestion. - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :return: IngestionRun. The IngestionRun is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} +def build_data_get_collection_tile_by_scale_and_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - cls: ClsType[_models.IngestionRun] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - _request = build_ingestion_create_run_request( - collection_id=collection_id, - ingestion_id=ingestion_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + _url: str = _url.format(**path_format_arguments) # type: ignore - response = pipeline_response.http_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionRun, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore +def build_data_get_collection_tile_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - @distributed_trace - def get_run(self, collection_id: str, ingestion_id: str, run_id: str, **kwargs: Any) -> _models.IngestionRun: - """Get a run of an ingestion. + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :param run_id: Run id. Required. - :type run_id: str - :return: IngestionRun. The IngestionRun is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + _url: str = _url.format(**path_format_arguments) # type: ignore - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - cls: ClsType[_models.IngestionRun] = kwargs.pop("cls", None) - - _request = build_ingestion_get_run_request( - collection_id=collection_id, - ingestion_id=ingestion_id, - run_id=run_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionRun, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore +def build_data_get_collection_tile_by_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - @distributed_trace - def list_runs( - self, - collection_id: str, - ingestion_id: str, - *, - top: Optional[int] = None, - skip: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.IngestionRun"]: - """Get the runs of an ingestion. + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :keyword top: The number of items to return. Default value is None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :return: An iterator like instance of IngestionRun - :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.IngestionRun] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _url: str = _url.format(**path_format_arguments) # type: ignore - cls: ClsType[List[_models.IngestionRun]] = kwargs.pop("cls", None) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - def prepare_request(next_link=None): - if not next_link: + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - _request = build_ingestion_list_runs_request( - collection_id=collection_id, - ingestion_id=ingestion_id, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_data_get_collection_tile_by_scale_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return _request + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IngestionRun], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + } - def get_next(next_link=None): - _request = prepare_request(next_link) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - @overload - def create( - self, - collection_id: str, - body: _models.IngestionDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.IngestionDefinition: - """Create a new ingestion. + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Definition of the ingestion. Required. - :type body: ~azure.planetarycomputer.models.IngestionDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - @overload - def create( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionDefinition: - """Create a new ingestion. - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Definition of the ingestion. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ +def build_data_get_collection_tile_no_tms_by_scale_and_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @overload - def create( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionDefinition: - """Create a new ingestion. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Definition of the ingestion. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{z}/{x}/{y}@{scale}x.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - @distributed_trace - def create( - self, collection_id: str, body: Union[_models.IngestionDefinition, JSON, IO[bytes]], **kwargs: Any - ) -> _models.IngestionDefinition: - """Create a new ingestion. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Definition of the ingestion. Is one of the following types: IngestionDefinition, - JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.IngestionDefinition or JSON or IO[bytes] - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IngestionDefinition] = kwargs.pop("cls", None) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_ingestion_create_request( - collection_id=collection_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) +def build_data_get_collection_tile_no_tms_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionDefinition, response.json()) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{z}/{x}/{y}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore - return deserialized # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - def _delete_initial(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_ingestion_delete_request( - collection_id=collection_id, - ingestion_id=ingestion_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_data_get_collection_tile_no_tms_by_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - response = pipeline_response.http_response + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{z}/{x}/{y}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + _url: str = _url.format(**path_format_arguments) # type: ignore - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - deserialized = response.iter_bytes() + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - return deserialized # type: ignore - @distributed_trace - def begin_delete(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> LROPoller[None]: - """Delete an ingestion from a catalog. All runs of the ingestion will be deleted. Ingestion must - not have any runs in progress or queued. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - collection_id=collection_id, - ingestion_id=ingestion_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> _models.IngestionDefinition: - """Get the definition of an ingestion. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) +def build_data_get_collection_tile_no_tms_by_scale_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - cls: ClsType[_models.IngestionDefinition] = kwargs.pop("cls", None) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{z}/{x}/{y}@{scale}x" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + } - _request = build_ingestion_get_request( - collection_id=collection_id, - ingestion_id=ingestion_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - response = pipeline_response.http_response + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionDefinition, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore +def build_data_get_collection_tile_json_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - @distributed_trace - def list( - self, collection_id: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.IngestionDefinition"]: - """Get ingestions of a catalog. + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tilejson.json" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + } - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :keyword top: The number of items to return. Default value is None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :return: An iterator like instance of IngestionDefinition - :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.IngestionDefinition] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _url: str = _url.format(**path_format_arguments) # type: ignore - cls: ClsType[List[_models.IngestionDefinition]] = kwargs.pop("cls", None) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - def prepare_request(next_link=None): - if not next_link: + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - _request = build_ingestion_list_request( - collection_id=collection_id, - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_data_get_collection_tile_json_tms_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return _request + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IngestionDefinition], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/{tileMatrixSetId}/tilejson.json" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } - def get_next(next_link=None): - _request = prepare_request(next_link) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return pipeline_response + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - return ItemPaged(get_next, extract_data) - @overload - def update( - self, - collection_id: str, - ingestion_id: str, - body: _models.IngestionDefinition, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.IngestionDefinition: - """Update an existing ingestion. +def build_data_get_collection_wmts_capabilities_request( # pylint: disable=name-too-long + collection_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :param body: Ingestion properties to update. Required. - :type body: ~azure.planetarycomputer.models.IngestionDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/xml") - @overload - def update( - self, - collection_id: str, - ingestion_id: str, - body: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.IngestionDefinition: - """Update an existing ingestion. + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/WMTSCapabilities.xml" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + } - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :param body: Ingestion properties to update. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ + _url: str = _url.format(**path_format_arguments) # type: ignore - @overload - def update( - self, - collection_id: str, - ingestion_id: str, - body: IO[bytes], - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.IngestionDefinition: - """Update an existing ingestion. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :param body: Ingestion properties to update. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - @distributed_trace - def update( - self, - collection_id: str, - ingestion_id: str, - body: Union[_models.IngestionDefinition, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.IngestionDefinition: - """Update an existing ingestion. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param ingestion_id: Ingestion id. Required. - :type ingestion_id: str - :param body: Ingestion properties to update. Is one of the following types: - IngestionDefinition, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.IngestionDefinition or JSON or IO[bytes] - :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionDefinition - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} +def build_data_get_collection_wmts_capabilities_tms_request( # pylint: disable=name-too-long + collection_id: str, + tile_matrix_set_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - cls: ClsType[_models.IngestionDefinition] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/xml") - content_type = content_type or "application/merge-patch+json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/{tileMatrixSetId}/WMTSCapabilities.xml" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } - _request = build_ingestion_update_request( - collection_id=collection_id, - ingestion_id=ingestion_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") - response = pipeline_response.http_response + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionDefinition, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore +def build_data_get_collection_assets_for_tile_request( # pylint: disable=name-too-long,too-many-locals + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - @overload - def create_source( - self, body: _models.IngestionSource, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionSource: - """Create a new ingestion source in a geo-catalog. + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}/assets" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - :param body: Definition of the ingestion source. Required. - :type body: ~azure.planetarycomputer.models.IngestionSource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ + _url: str = _url.format(**path_format_arguments) # type: ignore - @overload - def create_source( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionSource: - """Create a new ingestion source in a geo-catalog. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - :param body: Definition of the ingestion source. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - @overload - def create_source( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionSource: - """Create a new ingestion source in a geo-catalog. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - :param body: Definition of the ingestion source. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def create_source( - self, body: Union[_models.IngestionSource, JSON, IO[bytes]], **kwargs: Any - ) -> _models.IngestionSource: - """Create a new ingestion source in a geo-catalog. +def build_data_get_collection_assets_for_tile_no_tms_request( # pylint: disable=name-too-long,too-many-locals + collection_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param body: Definition of the ingestion source. Is one of the following types: - IngestionSource, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.IngestionSource or JSON or IO[bytes] - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/tiles/{z}/{x}/{y}/assets" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IngestionSource] = kwargs.pop("cls", None) + _url: str = _url.format(**path_format_arguments) # type: ignore - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") - _request = build_ingestion_create_source_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - response = pipeline_response.http_response - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) +def build_data_get_collection_assets_for_bbox_request( # pylint: disable=name-too-long,too-many-locals + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionSource, response.json()) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/bbox/{minx},{miny},{maxx},{maxy}/assets" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + } - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore - return deserialized # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") - @overload - def replace_source( - self, id: str, body: _models.IngestionSource, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionSource: - """Update an existing ingestion source in a geo-catalog. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - :param id: Ingestion source id. Required. - :type id: str - :param body: Definition of the ingestion source. Required. - :type body: ~azure.planetarycomputer.models.IngestionSource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - @overload - def replace_source( - self, id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionSource: - """Update an existing ingestion source in a geo-catalog. - :param id: Ingestion source id. Required. - :type id: str - :param body: Definition of the ingestion source. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ +def build_data_get_collection_info_request(collection_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @overload - def replace_source( - self, id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.IngestionSource: - """Update an existing ingestion source in a geo-catalog. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - :param id: Ingestion source id. Required. - :type id: str - :param body: Definition of the ingestion source. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/info" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + } - @distributed_trace - def replace_source( - self, id: str, body: Union[_models.IngestionSource, JSON, IO[bytes]], **kwargs: Any - ) -> _models.IngestionSource: - """Update an existing ingestion source in a geo-catalog. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param id: Ingestion source id. Required. - :type id: str - :param body: Definition of the ingestion source. Is one of the following types: - IngestionSource, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.IngestionSource or JSON or IO[bytes] - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IngestionSource] = kwargs.pop("cls", None) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_ingestion_replace_source_request( - id=id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionSource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized # type: ignore - - @distributed_trace - def delete_source(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an ingestion source from a geo-catalog. - - :param id: Ingestion source id. Required. - :type id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) +def build_data_get_collection_bbox_crop_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - cls: ClsType[None] = kwargs.pop("cls", None) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/bbox/{minx},{miny},{maxx},{maxy}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - _request = build_ingestion_delete_source_request( - id=id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") - response = pipeline_response.http_response + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace - def get_source(self, id: str, **kwargs: Any) -> _models.IngestionSource: - """Get an ingestion source in a geo-catalog. +def build_data_get_collection_bbox_crop_with_dimensions_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param id: Ingestion source id. Required. - :type id: str - :return: IngestionSource. The IngestionSource is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.IngestionSource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/bbox/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "width": _SERIALIZER.url("width", width, "int"), + "height": _SERIALIZER.url("height", height, "int"), + "format": _SERIALIZER.url("format", format, "str"), + } - cls: ClsType[_models.IngestionSource] = kwargs.pop("cls", None) + _url: str = _url.format(**path_format_arguments) # type: ignore - _request = build_ingestion_get_source_request( - id=id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - response = pipeline_response.http_response + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.IngestionSource, response.json()) +def build_data_crop_collection_feature_geo_json_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - return deserialized # type: ignore + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/feature" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + } - @distributed_trace - def list_sources( - self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.IngestionSourceSummary"]: - """Get ingestion sources in a geo-catalog. + _url: str = _url.format(**path_format_arguments) # type: ignore - :keyword top: The number of items to return. Default value is None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :return: An iterator like instance of IngestionSourceSummary - :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.IngestionSourceSummary] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") - cls: ClsType[List[_models.IngestionSourceSummary]] = kwargs.pop("cls", None) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - def prepare_request(next_link=None): - if not next_link: - _request = build_ingestion_list_sources_request( - top=top, - skip=skip, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_data_crop_collection_feature_geo_json_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.IngestionSourceSummary], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/feature.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "format": _SERIALIZER.url("format", format, "str"), + } - def get_next(next_link=None): - _request = prepare_request(next_link) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return pipeline_response + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - return ItemPaged(get_next, extract_data) - @distributed_trace - def list_managed_identities(self, **kwargs: Any) -> ItemPaged["_models.ManagedIdentityMetadata"]: - """Get all managed identities with access to storage accounts configured for a geo-catalog. +def build_data_crop_collection_feature_geo_json_width_by_height_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + collection_id: str, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :return: An iterator like instance of ManagedIdentityMetadata - :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.ManagedIdentityMetadata] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - cls: ClsType[List[_models.ManagedIdentityMetadata]] = kwargs.pop("cls", None) + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/feature/{width}x{height}.{format}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "width": _SERIALIZER.url("width", width, "int"), + "height": _SERIALIZER.url("height", height, "int"), + "format": _SERIALIZER.url("format", format, "str"), + } - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + _url: str = _url.format(**path_format_arguments) # type: ignore - def prepare_request(next_link=None): - if not next_link: + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") - _request = build_ingestion_list_managed_identities_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.endpoint", self._config.endpoint, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - return _request - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ManagedIdentityMetadata], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) +def build_data_get_collection_point_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches + collection_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def get_next(next_link=None): - _request = prepare_request(next_link) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/point/{longitude},{latitude}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "longitude": _SERIALIZER.url("longitude", longitude, "float"), + "latitude": _SERIALIZER.url("latitude", latitude, "float"), + } - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + _url: str = _url.format(**path_format_arguments) # type: ignore - return pipeline_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") - return ItemPaged(get_next, extract_data) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class StacOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s - :attr:`stac` attribute. - """ +def build_data_get_collection_point_assets_request( # pylint: disable=name-too-long,too-many-locals + collection_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PlanetaryComputerProClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - @overload - def create_collection_asset( - self, collection_id: str, body: _models.StacAssetData, **kwargs: Any - ) -> _models.StacCollection: - """Create Collection Asset. + # Construct URL + _url = "/data/mosaic/collections/{collectionId}/point/{longitude},{latitude}/assets" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + "longitude": _SERIALIZER.url("longitude", longitude, "float"), + "latitude": _SERIALIZER.url("latitude", latitude, "float"), + } - Create a new asset in the Collection metadata and write the associated file to managed storage. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Multi-part form data. Required. - :type body: ~azure.planetarycomputer.models.StacAssetData - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if ids is not None: + _params["ids"] = _SERIALIZER.query("ids", ids, "str") + if bbox is not None: + _params["bbox"] = _SERIALIZER.query("bbox", bbox, "str") + if query is not None: + _params["query"] = _SERIALIZER.query("query", query, "str") + if sortby is not None: + _params["sortby"] = _SERIALIZER.query("sortby", sortby, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") - @overload - def create_collection_asset(self, collection_id: str, body: JSON, **kwargs: Any) -> _models.StacCollection: - """Create Collection Asset. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - Create a new asset in the Collection metadata and write the associated file to managed storage. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Multi-part form data. Required. - :type body: JSON - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def create_collection_asset( - self, collection_id: str, body: Union[_models.StacAssetData, JSON], **kwargs: Any - ) -> _models.StacCollection: - """Create Collection Asset. +def build_data_list_searches_tilesets_request( # pylint: disable=name-too-long + search_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Create a new asset in the Collection metadata and write the associated file to managed storage. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Multi-part form data. Is either a StacAssetData type or a JSON type. Required. - :type body: ~azure.planetarycomputer.models.StacAssetData or JSON - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + } - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _url: str = _url.format(**path_format_arguments) # type: ignore - cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - _body = body.as_dict() if isinstance(body, _Model) else body - _file_fields: list[str] = ["file"] - _data_fields: list[str] = ["data"] - _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _request = build_stac_create_collection_asset_request( - collection_id=collection_id, - api_version=self._config.api_version, - files=_files, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response +def build_data_get_searches_tileset_metadata_request( # pylint: disable=name-too-long + search_id: str, + tile_matrix_set_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacCollection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - return deserialized # type: ignore + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{tileMatrixSetId}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } - @overload - def replace_collection_asset( - self, collection_id: str, asset_id: str, body: _models.StacAssetData, **kwargs: Any - ) -> _models.StacCollection: - """Update Collection Asset. + _url: str = _url.format(**path_format_arguments) # type: ignore - Update an existing asset in a given collection. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param asset_id: STAC Asset ID. Required. - :type asset_id: str - :param body: Multi-part form data. Required. - :type body: ~azure.planetarycomputer.models.StacAssetData - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - @overload - def replace_collection_asset( - self, collection_id: str, asset_id: str, body: JSON, **kwargs: Any - ) -> _models.StacCollection: - """Update Collection Asset. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - Update an existing asset in a given collection. - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param asset_id: STAC Asset ID. Required. - :type asset_id: str - :param body: Multi-part form data. Required. - :type body: JSON - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ +def build_data_get_searches_tile_by_scale_and_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace - def replace_collection_asset( - self, collection_id: str, asset_id: str, body: Union[_models.StacAssetData, JSON], **kwargs: Any - ) -> _models.StacCollection: - """Update Collection Asset. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - Update an existing asset in a given collection. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param asset_id: STAC Asset ID. Required. - :type asset_id: str - :param body: Multi-part form data. Is either a StacAssetData type or a JSON type. Required. - :type body: ~azure.planetarycomputer.models.StacAssetData or JSON - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + _url: str = _url.format(**path_format_arguments) # type: ignore - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _body = body.as_dict() if isinstance(body, _Model) else body - _file_fields: list[str] = ["file"] - _data_fields: list[str] = ["data"] - _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - _request = build_stac_replace_collection_asset_request( - collection_id=collection_id, - asset_id=asset_id, - api_version=self._config.api_version, - files=_files, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) +def build_data_get_searches_tile_request( # pylint: disable=too-many-locals,too-many-statements,too-many-branches + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - response = pipeline_response.http_response + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacCollection, response.json()) + _url: str = _url.format(**path_format_arguments) # type: ignore - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - return deserialized # type: ignore + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - @distributed_trace - def delete_collection_asset(self, collection_id: str, asset_id: str, **kwargs: Any) -> _models.StacCollection: - """Delete Collection Asset. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - Delete an asset from a given collection. - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param asset_id: STAC Asset ID. Required. - :type asset_id: str - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) +def build_data_get_searches_tile_by_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - _request = build_stac_delete_collection_asset_request( - collection_id=collection_id, - asset_id=asset_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - response = pipeline_response.http_response + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacCollection, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore +def build_data_get_searches_tile_by_scale_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - @distributed_trace - def get_collection_configuration(self, collection_id: str, **kwargs: Any) -> _models.UserCollectionSettings: - """Get Config. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + } - Get the complete user configuration for a given collection. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :return: UserCollectionSettings. The UserCollectionSettings is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.UserCollectionSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.UserCollectionSettings] = kwargs.pop("cls", None) - - _request = build_stac_get_collection_configuration_request( - collection_id=collection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.UserCollectionSettings, response.json()) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized # type: ignore +def build_data_get_searches_assets_for_tile_request( # pylint: disable=name-too-long + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + collection_id: str, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @overload - def add_mosaic( - self, collection_id: str, body: _models.StacMosaic, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacMosaic: - """Add Collection Mosaic. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - Add a mosaic definition to a given collection. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{tileMatrixSetId}/{z}/{x}/{y}/assets" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Mosaic definition to be created or updated. Required. - :type body: ~azure.planetarycomputer.models.StacMosaic - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ + _url: str = _url.format(**path_format_arguments) # type: ignore - @overload - def add_mosaic( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacMosaic: - """Add Collection Mosaic. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + _params["collection"] = _SERIALIZER.query("collection_id", collection_id, "str") - Add a mosaic definition to a given collection. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Mosaic definition to be created or updated. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - @overload - def add_mosaic( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacMosaic: - """Add Collection Mosaic. - Add a mosaic definition to a given collection. +def build_data_get_searches_tile_json_tms_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Mosaic definition to be created or updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - @distributed_trace - def add_mosaic( - self, collection_id: str, body: Union[_models.StacMosaic, JSON, IO[bytes]], **kwargs: Any - ) -> _models.StacMosaic: - """Add Collection Mosaic. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/{tileMatrixSetId}/tilejson.json" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } - Add a mosaic definition to a given collection. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Mosaic definition to be created or updated. Is one of the following types: - StacMosaic, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacMosaic or JSON or IO[bytes] - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacMosaic] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_stac_add_mosaic_request( - collection_id=collection_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - response = pipeline_response.http_response + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacMosaic, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore +def build_data_get_searches_wmts_capabilities_tms_request( # pylint: disable=name-too-long + search_id: str, + tile_matrix_set_id: str, + *, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/xml") - @overload - def replace_mosaic( - self, - collection_id: str, - mosaic_id: str, - body: _models.StacMosaic, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacMosaic: - """Update Collection Mosaic. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/{tileMatrixSetId}/WMTSCapabilities.xml" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "tileMatrixSetId": _SERIALIZER.url("tile_matrix_set_id", tile_matrix_set_id, "str"), + } - Update a mosaic definition from a given collection. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param mosaic_id: Unique identifier for the mosaic configuration. Required. - :type mosaic_id: str - :param body: Mosaic definition to be created or updated. Required. - :type body: ~azure.planetarycomputer.models.StacMosaic - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") - @overload - def replace_mosaic( - self, collection_id: str, mosaic_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacMosaic: - """Update Collection Mosaic. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - Update a mosaic definition from a given collection. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param mosaic_id: Unique identifier for the mosaic configuration. Required. - :type mosaic_id: str - :param body: Mosaic definition to be created or updated. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def replace_mosaic( - self, - collection_id: str, - mosaic_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacMosaic: - """Update Collection Mosaic. +def build_data_get_searches_info_request(search_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Update a mosaic definition from a given collection. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param mosaic_id: Unique identifier for the mosaic configuration. Required. - :type mosaic_id: str - :param body: Mosaic definition to be created or updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ + # Construct URL + _url = "/data/mosaic/searches/{searchId}/info" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + } - @distributed_trace - def replace_mosaic( - self, collection_id: str, mosaic_id: str, body: Union[_models.StacMosaic, JSON, IO[bytes]], **kwargs: Any - ) -> _models.StacMosaic: - """Update Collection Mosaic. + _url: str = _url.format(**path_format_arguments) # type: ignore - Update a mosaic definition from a given collection. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param mosaic_id: Unique identifier for the mosaic configuration. Required. - :type mosaic_id: str - :param body: Mosaic definition to be created or updated. Is one of the following types: - StacMosaic, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacMosaic or JSON or IO[bytes] - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacMosaic] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_stac_replace_mosaic_request( - collection_id=collection_id, - mosaic_id=mosaic_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacMosaic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_mosaic( # pylint: disable=inconsistent-return-statements - self, collection_id: str, mosaic_id: str, **kwargs: Any - ) -> None: - """Delete Collection Mosaic. +def build_data_get_searches_bbox_crop_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Delete a mosaic definition from a given collection. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param mosaic_id: Unique identifier for the mosaic configuration. Required. - :type mosaic_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/bbox/{minx},{miny},{maxx},{maxy}.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _url: str = _url.format(**path_format_arguments) # type: ignore - cls: ClsType[None] = kwargs.pop("cls", None) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") - _request = build_stac_delete_mosaic_request( - collection_id=collection_id, - mosaic_id=mosaic_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) +def build_data_get_searches_bbox_crop_with_dimensions_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - if cls: - return cls(pipeline_response, None, {}) # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - @distributed_trace - def get_mosaic(self, collection_id: str, mosaic_id: str, **kwargs: Any) -> _models.StacMosaic: - """Get Collection Mosaic. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/bbox/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + "width": _SERIALIZER.url("width", width, "int"), + "height": _SERIALIZER.url("height", height, "int"), + "format": _SERIALIZER.url("format", format, "str"), + } - Get a mosaic definition from a given collection. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param mosaic_id: Unique identifier for the mosaic configuration. Required. - :type mosaic_id: str - :return: StacMosaic. The StacMosaic is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacMosaic - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.StacMosaic] = kwargs.pop("cls", None) - - _request = build_stac_get_mosaic_request( - collection_id=collection_id, - mosaic_id=mosaic_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacMosaic, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") - @distributed_trace - def list_mosaics(self, collection_id: str, **kwargs: Any) -> List[_models.StacMosaic]: - """Get Collection Mosaics. + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - Get the mosaic definitions for a given collection. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :return: list of StacMosaic - :rtype: list[~azure.planetarycomputer.models.StacMosaic] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} +def build_data_get_searches_bbox_assets_request( # pylint: disable=name-too-long + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - cls: ClsType[List[_models.StacMosaic]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - _request = build_stac_list_mosaics_request( - collection_id=collection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/bbox/{minx},{miny},{maxx},{maxy}/assets" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "minx": _SERIALIZER.url("minx", minx, "float"), + "miny": _SERIALIZER.url("miny", miny, "float"), + "maxx": _SERIALIZER.url("maxx", maxx, "float"), + "maxy": _SERIALIZER.url("maxy", maxy, "float"), + } - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + _url: str = _url.format(**path_format_arguments) # type: ignore - response = pipeline_response.http_response + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[_models.StacMosaic], response.json()) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized # type: ignore +def build_data_crop_searches_feature_geo_json_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def _create_collection_initial( - self, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + # Construct URL + _url = "/data/mosaic/searches/{searchId}/feature" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + } - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + _url: str = _url.format(**path_format_arguments) # type: ignore - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") - _request = build_stac_create_collection_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - response = pipeline_response.http_response - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) +def build_data_crop_searches_feature_geo_json_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - deserialized = response.iter_bytes() + # Construct URL + _url = "/data/mosaic/searches/{searchId}/feature.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "format": _SERIALIZER.url("format", format, "str"), + } - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore - return deserialized # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if height is not None: + _params["height"] = _SERIALIZER.query("height", height, "int") + if width is not None: + _params["width"] = _SERIALIZER.query("width", width, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") - @overload - def begin_create_collection( - self, body: _models.StacCollection, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Create Collection. + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - Create a new collection in the GeoCatalog instance. + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - :param body: Request collection body. Required. - :type body: ~azure.planetarycomputer.models.StacCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def begin_create_collection( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Create Collection. +def build_data_crop_searches_feature_geo_json_width_by_height_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Create a new collection in the GeoCatalog instance. + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - :param body: Request collection body. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_collection( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Create Collection. - - Create a new collection in the GeoCatalog instance. - - :param body: Request collection body. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_collection( - self, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Create Collection. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/feature/{width}x{height}.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "width": _SERIALIZER.url("width", width, "int"), + "height": _SERIALIZER.url("height", height, "int"), + "format": _SERIALIZER.url("format", format, "str"), + } - Create a new collection in the GeoCatalog instance. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param body: Request collection body. Is one of the following types: StacCollection, JSON, - IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacCollection or JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if max_size is not None: + _params["max_size"] = _SERIALIZER.query("max_size", max_size, "int") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if destination_crs is not None: + _params["dst_crs"] = _SERIALIZER.query("destination_crs", destination_crs, "str") - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_collection_initial( - body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore +def build_data_get_searches_wmts_capabilities_request( # pylint: disable=name-too-long + search_id: str, + *, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @overload - def create_or_replace_collection( - self, collection_id: str, body: _models.StacCollection, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacCollection: - """Create or update Collection. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/xml") - Create or replace a collection in the GeoCatalog instance. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/WMTSCapabilities.xml" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + } - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Request collection body. Required. - :type body: ~azure.planetarycomputer.models.StacCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ + _url: str = _url.format(**path_format_arguments) # type: ignore - @overload - def create_or_replace_collection( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacCollection: - """Create or update Collection. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") - Create or replace a collection in the GeoCatalog instance. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Request collection body. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - @overload - def create_or_replace_collection( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacCollection: - """Create or update Collection. - Create or replace a collection in the GeoCatalog instance. +def build_data_get_searches_tile_json_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + padding: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection_id: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + rescale: Optional[List[str]] = None, + colormap_name: Optional[Union[str, _models.ColorMapNames]] = None, + colormap: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Request collection body. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - @distributed_trace - def create_or_replace_collection( - self, collection_id: str, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any - ) -> _models.StacCollection: - """Create or update Collection. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tilejson.json" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + } - Create or replace a collection in the GeoCatalog instance. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: Request collection body. Is one of the following types: StacCollection, JSON, - IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacCollection or JSON or IO[bytes] - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if tile_format is not None: + _params["tile_format"] = _SERIALIZER.query("tile_format", tile_format, "str") + if tile_scale is not None: + _params["tile_scale"] = _SERIALIZER.query("tile_scale", tile_scale, "int") + if min_zoom is not None: + _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") + if max_zoom is not None: + _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection_id is not None: + _params["collection"] = _SERIALIZER.query("collection_id", collection_id, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if colormap_name is not None: + _params["colormap_name"] = _SERIALIZER.query("colormap_name", colormap_name, "str") + if colormap is not None: + _params["colormap"] = _SERIALIZER.query("colormap", colormap, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_create_or_replace_collection_request( - collection_id=collection_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) +def build_data_get_searches_tile_no_tms_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - response = pipeline_response.http_response + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{z}/{x}/{y}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + _url: str = _url.format(**path_format_arguments) # type: ignore - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacCollection, response.json()) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return deserialized # type: ignore + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - def _delete_collection_initial(self, collection_id: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} +def build_data_get_searches_tile_no_tms_by_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - _request = build_stac_delete_collection_request( - collection_id=collection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{z}/{x}/{y}.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + _url: str = _url.format(**path_format_arguments) # type: ignore - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if scale is not None: + _params["scale"] = _SERIALIZER.query("scale", scale, "int") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - deserialized = response.iter_bytes() + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized # type: ignore +def build_data_get_searches_tile_no_tms_by_scale_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - @distributed_trace - def begin_delete_collection(self, collection_id: str, **kwargs: Any) -> LROPoller[None]: - """Delete Collection. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - Delete a collection in the GeoCatalog instance. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{z}/{x}/{y}@{scale}x" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + } - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + _url: str = _url.format(**path_format_arguments) # type: ignore - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_collection_initial( - collection_id=collection_id, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace - def get_collection( - self, - collection_id: str, - *, - sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, - duration_in_minutes: Optional[int] = None, - **kwargs: Any - ) -> _models.StacCollection: - """Get Collection. +def build_data_get_searches_tile_no_tms_by_scale_and_format_request( # pylint: disable=name-too-long,too-many-locals,too-many-statements,too-many-branches + search_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Get a collection in the GeoCatalog instance. + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", None) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and - "false". Default value is None. - :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode - :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. - :paramtype duration_in_minutes: int - :return: StacCollection. The StacCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) - - _request = build_stac_get_collection_request( - collection_id=collection_id, - sign=sign, - duration_in_minutes=duration_in_minutes, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{z}/{x}/{y}@{scale}x.{format}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + "scale": _SERIALIZER.url("scale", scale, "float"), + "format": _SERIALIZER.url("format", format, "str"), + } - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacCollection, response.json()) + _url: str = _url.format(**path_format_arguments) # type: ignore - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if algorithm is not None: + _params["algorithm"] = _SERIALIZER.query("algorithm", algorithm, "str") + if algorithm_params is not None: + _params["algorithm_params"] = _SERIALIZER.query("algorithm_params", algorithm_params, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") + if buffer is not None: + _params["buffer"] = _SERIALIZER.query("buffer", buffer, "float") + if color_formula is not None: + _params["color_formula"] = _SERIALIZER.query("color_formula", color_formula, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + if pixel_selection is not None: + _params["pixel_selection"] = _SERIALIZER.query("pixel_selection", pixel_selection, "str") + if rescale is not None: + _params["rescale"] = [_SERIALIZER.query("rescale", q, "str") if q is not None else "" for q in rescale] + if color_map_name is not None: + _params["colormap_name"] = _SERIALIZER.query("color_map_name", color_map_name, "str") + if color_map is not None: + _params["colormap"] = _SERIALIZER.query("color_map", color_map, "str") + if return_mask is not None: + _params["return_mask"] = _SERIALIZER.query("return_mask", return_mask, "bool") + if padding is not None: + _params["padding"] = _SERIALIZER.query("padding", padding, "int") - return deserialized # type: ignore + # Construct headers + if accept is not None: + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - @distributed_trace - def get_collections( - self, - *, - sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, - duration_in_minutes: Optional[int] = None, - **kwargs: Any - ) -> _models.StacCatalogCollections: - """Get Collections. + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - List all collections in the GeoCatalog instance. - :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and - "false". Default value is None. - :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode - :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. - :paramtype duration_in_minutes: int - :return: StacCatalogCollections. The StacCatalogCollections is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacCatalogCollections - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) +def build_data_get_searches_assets_for_tile_no_tms_request( # pylint: disable=name-too-long + search_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - cls: ClsType[_models.StacCatalogCollections] = kwargs.pop("cls", None) + # Construct URL + _url = "/data/mosaic/searches/{searchId}/tiles/{z}/{x}/{y}/assets" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "z": _SERIALIZER.url("z", z, "float"), + "x": _SERIALIZER.url("x", x, "float"), + "y": _SERIALIZER.url("y", y, "float"), + } - _request = build_stac_get_collections_request( - sign=sign, - duration_in_minutes=duration_in_minutes, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _url: str = _url.format(**path_format_arguments) # type: ignore - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if tile_matrix_set_id is not None: + _params["TileMatrixSetId"] = _SERIALIZER.query("tile_matrix_set_id", tile_matrix_set_id, "str") - response = pipeline_response.http_response + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacCatalogCollections, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore +def build_data_get_searches_point_request( # pylint: disable=too-many-locals + search_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") - @distributed_trace - def get_partition_type(self, collection_id: str, **kwargs: Any) -> _models.PartitionType: - """Get Partitiontype. + # Construct URL + _url = "/data/mosaic/searches/{searchId}/point/{longitude},{latitude}" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "longitude": _SERIALIZER.url("longitude", longitude, "float"), + "latitude": _SERIALIZER.url("latitude", latitude, "float"), + } - Get the partitiontype for a GeoCatalog Collection. + _url: str = _url.format(**path_format_arguments) # type: ignore - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :return: PartitionType. The PartitionType is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.PartitionType + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + if resampling is not None: + _params["resampling"] = _SERIALIZER.query("resampling", resampling, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_get_searches_point_with_assets_request( # pylint: disable=name-too-long + search_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/data/mosaic/searches/{searchId}/point/{longitude},{latitude}/assets" + path_format_arguments = { + "searchId": _SERIALIZER.url("search_id", search_id, "str"), + "longitude": _SERIALIZER.url("longitude", longitude, "float"), + "latitude": _SERIALIZER.url("latitude", latitude, "float"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if scan_limit is not None: + _params["scan_limit"] = _SERIALIZER.query("scan_limit", scan_limit, "int") + if items_limit is not None: + _params["items_limit"] = _SERIALIZER.query("items_limit", items_limit, "int") + if time_limit is not None: + _params["time_limit"] = _SERIALIZER.query("time_limit", time_limit, "int") + if exit_when_full is not None: + _params["exitwhenfull"] = _SERIALIZER.query("exit_when_full", exit_when_full, "bool") + if skip_covered is not None: + _params["skipcovered"] = _SERIALIZER.query("skip_covered", skip_covered, "bool") + if subdataset_name is not None: + _params["subdataset_name"] = _SERIALIZER.query("subdataset_name", subdataset_name, "str") + if subdataset_bands is not None: + _params["subdataset_bands"] = _SERIALIZER.query("subdataset_bands", subdataset_bands, "[int]", div=",") + if crs is not None: + _params["crs"] = _SERIALIZER.query("crs", crs, "str") + if datetime is not None: + _params["datetime"] = _SERIALIZER.query("datetime", datetime, "str") + if sel is not None: + _params["sel"] = [_SERIALIZER.query("sel", q, "str") if q is not None else "" for q in sel] + if sel_method is not None: + _params["sel_method"] = _SERIALIZER.query("sel_method", sel_method, "str") + if collection is not None: + _params["collection"] = _SERIALIZER.query("collection", collection, "str") + if coordinate_reference_system is not None: + _params["coord_crs"] = _SERIALIZER.query("coordinate_reference_system", coordinate_reference_system, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sas_get_sign_request(*, href: str, duration_in_minutes: Optional[int] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/sas/sign" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["href"] = _SERIALIZER.query("href", href, "str") + if duration_in_minutes is not None: + _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sas_get_token_request( + collection_id: str, *, duration_in_minutes: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/sas/token/{collectionId}" + path_format_arguments = { + "collectionId": _SERIALIZER.url("collection_id", collection_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if duration_in_minutes is not None: + _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sas_revoke_token_request(*, duration_in_minutes: Optional[int] = None, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-15")) + # Construct URL + _url = "/sas/token/revoke" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if duration_in_minutes is not None: + _params["duration"] = _SERIALIZER.query("duration_in_minutes", duration_in_minutes, "int") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +class IngestionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s + :attr:`ingestion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PlanetaryComputerProClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def cancel_operation( # pylint: disable=inconsistent-return-statements + self, operation_id: str, **kwargs: Any + ) -> None: + """Cancel a running operation of a geo-catalog collection. + + :param operation_id: Operation id. Required. + :type operation_id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6413,10 +10323,10 @@ def get_partition_type(self, collection_id: str, **kwargs: Any) -> _models.Parti _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PartitionType] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_stac_get_partition_type_request( - collection_id=collection_id, + _request = build_ingestion_cancel_operation_request( + operation_id=operation_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6426,162 +10336,44 @@ def get_partition_type(self, collection_id: str, **kwargs: Any) -> _models.Parti } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.PartitionType, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def replace_partition_type( - self, collection_id: str, body: _models.PartitionType, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Create Partitiontype. - - Updates partition type for a GeoCatalog Collection. This will - determine the partitioning scheme for items within the database, - and can only be set before any items are loaded. - - Ideal partitioning schemes result in partitions of roughly 100k items each. + return cls(pipeline_response, None, {}) # type: ignore - The default partitioning scheme is "none" which does not partition items. + @distributed_trace + def cancel_all_operations(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Cancel all pending and running operations across the entire GeoCatalog instance. This is a + catalog-wide operation and is not scoped to a specific collection. - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Partition type configuration determining how items are partitioned in storage. - Required. - :type body: ~azure.planetarycomputer.models.PartitionType - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def replace_partition_type( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Create Partitiontype. - - Updates partition type for a GeoCatalog Collection. This will - determine the partitioning scheme for items within the database, - and can only be set before any items are loaded. - - Ideal partitioning schemes result in partitions of roughly 100k items each. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - The default partitioning scheme is "none" which does not partition items. + cls: ClsType[None] = kwargs.pop("cls", None) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Partition type configuration determining how items are partitioned in storage. - Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def replace_partition_type( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Create Partitiontype. - - Updates partition type for a GeoCatalog Collection. This will - determine the partitioning scheme for items within the database, - and can only be set before any items are loaded. - - Ideal partitioning schemes result in partitions of roughly 100k items each. - - The default partitioning scheme is "none" which does not partition items. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Partition type configuration determining how items are partitioned in storage. - Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def replace_partition_type( # pylint: disable=inconsistent-return-statements - self, collection_id: str, body: Union[_models.PartitionType, JSON, IO[bytes]], **kwargs: Any - ) -> None: - """Create Partitiontype. - - Updates partition type for a GeoCatalog Collection. This will - determine the partitioning scheme for items within the database, - and can only be set before any items are loaded. - - Ideal partitioning schemes result in partitions of roughly 100k items each. - - The default partitioning scheme is "none" which does not partition items. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Partition type configuration determining how items are partitioned in storage. Is - one of the following types: PartitionType, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.PartitionType or JSON or IO[bytes] - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_stac_replace_partition_type_request( - collection_id=collection_id, - content_type=content_type, + _request = build_ingestion_cancel_all_operations_request( api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6597,88 +10389,21 @@ def replace_partition_type( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore - @overload - def create_render_option( - self, collection_id: str, body: _models.RenderOption, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RenderOption: - """Add Collection Render Option. - - Add a render option for a given collection. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Render option configuration to be created or updated. Required. - :type body: ~azure.planetarycomputer.models.RenderOption - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_render_option( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RenderOption: - """Add Collection Render Option. - - Add a render option for a given collection. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Render option configuration to be created or updated. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_render_option( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RenderOption: - """Add Collection Render Option. - - Add a render option for a given collection. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Render option configuration to be created or updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def create_render_option( - self, collection_id: str, body: Union[_models.RenderOption, JSON, IO[bytes]], **kwargs: Any - ) -> _models.RenderOption: - """Add Collection Render Option. - - Add a render option for a given collection. + def get_operation(self, operation_id: str, **kwargs: Any) -> _models.Operation: + """Get an operation of a geo-catalog collection. - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Render option configuration to be created or updated. Is one of the following - types: RenderOption, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.RenderOption or JSON or IO[bytes] - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption + :param operation_id: Operation id. Required. + :type operation_id: str + :return: Operation. The Operation is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.Operation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6689,24 +10414,14 @@ def create_render_option( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RenderOption] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Operation] = kwargs.pop("cls", None) - _request = build_stac_create_render_option_request( - collection_id=collection_id, - content_type=content_type, + _request = build_ingestion_get_operation_request( + operation_id=operation_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6715,6 +10430,7 @@ def create_render_option( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6722,7 +10438,7 @@ def create_render_option( response = pipeline_response.http_response - if response.status_code not in [201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -6732,120 +10448,131 @@ def create_render_option( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RenderOption, response.json()) + deserialized = _deserialize(_models.Operation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def replace_render_option( + @distributed_trace + def list_operations( self, - collection_id: str, - render_option_id: str, - body: _models.RenderOption, *, - content_type: str = "application/json", + top: Optional[int] = None, + skip: Optional[int] = None, + collection_id: Optional[str] = None, + status: Optional[Union[str, _models.OperationStatus]] = None, **kwargs: Any - ) -> _models.RenderOption: - """Update Collection Render Option. - - Update a render option for a given collection. + ) -> ItemPaged["_models.Operation"]: + """Get operations of a geo-catalog collection. - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param render_option_id: Unique identifier for the render option. Required. - :type render_option_id: str - :param body: Render option configuration to be created or updated. Required. - :type body: ~azure.planetarycomputer.models.RenderOption - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption + :keyword top: The number of items to return. Default value is None. + :paramtype top: int + :keyword skip: The number of items to skip. Default value is None. + :paramtype skip: int + :keyword collection_id: Operation id used to filter the results. Default value is None. + :paramtype collection_id: str + :keyword status: Operation status used to filter the results. Known values are: "Pending", + "Running", "Succeeded", "Canceled", "Canceling", and "Failed". Default value is None. + :paramtype status: str or ~azure.planetarycomputer.models.OperationStatus + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def replace_render_option( - self, - collection_id: str, - render_option_id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RenderOption: - """Update Collection Render Option. + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - Update a render option for a given collection. + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param render_option_id: Unique identifier for the render option. Required. - :type render_option_id: str - :param body: Render option configuration to be created or updated. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption - :raises ~azure.core.exceptions.HttpResponseError: - """ + def prepare_request(next_link=None): + if not next_link: - @overload - def replace_render_option( - self, - collection_id: str, - render_option_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RenderOption: - """Update Collection Render Option. + _request = build_ingestion_list_operations_request( + top=top, + skip=skip, + collection_id=collection_id, + status=status, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - Update a render option for a given collection. + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param render_option_id: Unique identifier for the render option. Required. - :type render_option_id: str - :param body: Render option configuration to be created or updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption - :raises ~azure.core.exceptions.HttpResponseError: - """ + return _request - @distributed_trace - def replace_render_option( - self, - collection_id: str, - render_option_id: str, - body: Union[_models.RenderOption, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.RenderOption: - """Update Collection Render Option. + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - Update a render option for a given collection. + def get_next(next_link=None): + _request = prepare_request(next_link) - :param collection_id: Unique identifier for the STAC collection. Required. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def create_run(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> _models.IngestionRun: + """Create a new run of an ingestion. + + :param collection_id: Catalog collection id. Required. :type collection_id: str - :param render_option_id: Unique identifier for the render option. Required. - :type render_option_id: str - :param body: Render option configuration to be created or updated. Is one of the following - types: RenderOption, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.RenderOption or JSON or IO[bytes] - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :return: IngestionRun. The IngestionRun is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6856,25 +10583,15 @@ def replace_render_option( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RenderOption] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.IngestionRun] = kwargs.pop("cls", None) - _request = build_stac_replace_render_option_request( + _request = build_ingestion_create_run_request( collection_id=collection_id, - render_option_id=render_option_id, - content_type=content_type, + ingestion_id=ingestion_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6883,6 +10600,7 @@ def replace_render_option( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -6890,7 +10608,7 @@ def replace_render_option( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -6899,83 +10617,31 @@ def replace_render_option( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RenderOption, response.json()) + deserialized = _deserialize(_models.IngestionRun, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def delete_render_option( # pylint: disable=inconsistent-return-statements - self, collection_id: str, render_option_id: str, **kwargs: Any - ) -> None: - """Delete Collection Render Option. - - Delete a render option for a given collection. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param render_option_id: Unique identifier for the render option. Required. - :type render_option_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_stac_delete_render_option_request( - collection_id=collection_id, - render_option_id=render_option_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get_render_option(self, collection_id: str, render_option_id: str, **kwargs: Any) -> _models.RenderOption: - """Get Collection Render Option. - - Get a render option for a given collection. + def get_run(self, collection_id: str, ingestion_id: str, run_id: str, **kwargs: Any) -> _models.IngestionRun: + """Get a run of an ingestion. - :param collection_id: Unique identifier for the STAC collection. Required. + :param collection_id: Catalog collection id. Required. :type collection_id: str - :param render_option_id: Unique identifier for the render option. Required. - :type render_option_id: str - :return: RenderOption. The RenderOption is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.RenderOption + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :param run_id: Run id. Required. + :type run_id: str + :return: IngestionRun. The IngestionRun is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6989,11 +10655,12 @@ def get_render_option(self, collection_id: str, render_option_id: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RenderOption] = kwargs.pop("cls", None) + cls: ClsType[_models.IngestionRun] = kwargs.pop("cls", None) - _request = build_stac_get_render_option_request( + _request = build_ingestion_get_run_request( collection_id=collection_id, - render_option_id=render_option_id, + ingestion_id=ingestion_id, + run_id=run_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7003,6 +10670,7 @@ def get_render_option(self, collection_id: str, render_option_id: str, **kwargs: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7020,9 +10688,9 @@ def get_render_option(self, collection_id: str, render_option_id: str, **kwargs: raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RenderOption, response.json()) + deserialized = _deserialize(_models.IngestionRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7030,17 +10698,34 @@ def get_render_option(self, collection_id: str, render_option_id: str, **kwargs: return deserialized # type: ignore @distributed_trace - def list_render_options(self, collection_id: str, **kwargs: Any) -> List[_models.RenderOption]: - """Get Collection Render Options. - - Get all render options for a given collection. + def list_runs( + self, + collection_id: str, + ingestion_id: str, + *, + top: Optional[int] = None, + skip: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.IngestionRun"]: + """Get the runs of an ingestion. - :param collection_id: Unique identifier for the STAC collection. Required. + :param collection_id: Catalog collection id. Required. :type collection_id: str - :return: list of RenderOption - :rtype: list[~azure.planetarycomputer.models.RenderOption] + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :keyword top: The number of items to return. Default value is None. + :paramtype top: int + :keyword skip: The number of items to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of IngestionRun + :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.IngestionRun] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IngestionRun]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7049,58 +10734,146 @@ def list_render_options(self, collection_id: str, **kwargs: Any) -> List[_models } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[List[_models.RenderOption]] = kwargs.pop("cls", None) + _request = build_ingestion_list_runs_request( + collection_id=collection_id, + ingestion_id=ingestion_id, + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_stac_list_render_options_request( - collection_id=collection_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + return _request - response = pipeline_response.http_response + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IngestionRun], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + def get_next(next_link=None): + _request = prepare_request(next_link) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[_models.RenderOption], response.json()) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - return deserialized # type: ignore + return pipeline_response - @distributed_trace - def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> Iterator[bytes]: - """Get Collection Thumbnail. + return ItemPaged(get_next, extract_data) - Get thumbnail for given collection. + @overload + def create( + self, + collection_id: str, + body: _models.IngestionDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IngestionDefinition: + """Create a new ingestion. - :param collection_id: STAC Collection ID. Required. + :param collection_id: Catalog collection id. Required. :type collection_id: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param body: Definition of the ingestion. Required. + :type body: ~azure.planetarycomputer.models.IngestionDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionDefinition: + """Create a new ingestion. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Definition of the ingestion. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionDefinition: + """Create a new ingestion. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Definition of the ingestion. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, collection_id: str, body: Union[_models.IngestionDefinition, JSON, IO[bytes]], **kwargs: Any + ) -> _models.IngestionDefinition: + """Create a new ingestion. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Definition of the ingestion. Is one of the following types: IngestionDefinition, + JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.IngestionDefinition or JSON or IO[bytes] + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7111,14 +10884,24 @@ def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> Iterato } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IngestionDefinition] = kwargs.pop("cls", None) - _request = build_stac_get_collection_thumbnail_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ingestion_create_request( collection_id=collection_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7127,14 +10910,15 @@ def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> Iterato } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -7144,33 +10928,19 @@ def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> Iterato raise HttpResponseError(response=response) response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IngestionDefinition, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def get_tile_settings(self, collection_id: str, **kwargs: Any) -> _models.TileSettings: - """Get Collection Tile Settings. - - Get the tile settings for a given collection. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :return: TileSettings. The TileSettings is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _delete_initial(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7182,10 +10952,11 @@ def get_tile_settings(self, collection_id: str, **kwargs: Any) -> _models.TileSe _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TileSettings] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_stac_get_tile_settings_request( + _request = build_ingestion_delete_request( collection_id=collection_id, + ingestion_id=ingestion_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7195,107 +10966,100 @@ def get_tile_settings(self, collection_id: str, **kwargs: Any) -> _models.TileSe } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TileSettings, response.json()) + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def replace_tile_settings( - self, collection_id: str, body: _models.TileSettings, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TileSettings: - """Update Collection Tile Settings. - - Update the tile settings for a given collection. + @distributed_trace + def begin_delete(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> LROPoller[None]: + """Delete an ingestion from a catalog. All runs of the ingestion will be deleted. Ingestion must + not have any runs in progress or queued. - :param collection_id: Unique identifier for the STAC collection. Required. + :param collection_id: Catalog collection id. Required. :type collection_id: str - :param body: Tile settings configuration to be updated. Required. - :type body: ~azure.planetarycomputer.models.TileSettings - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TileSettings. The TileSettings is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileSettings + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def replace_tile_settings( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TileSettings: - """Update Collection Tile Settings. - - Update the tile settings for a given collection. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Tile settings configuration to be updated. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TileSettings. The TileSettings is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + collection_id=collection_id, + ingestion_id=ingestion_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - @overload - def replace_tile_settings( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TileSettings: - """Update Collection Tile Settings. + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - Update the tile settings for a given collection. + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Tile settings configuration to be updated. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TileSettings. The TileSettings is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def replace_tile_settings( - self, collection_id: str, body: Union[_models.TileSettings, JSON, IO[bytes]], **kwargs: Any - ) -> _models.TileSettings: - """Update Collection Tile Settings. - - Update the tile settings for a given collection. + def get(self, collection_id: str, ingestion_id: str, **kwargs: Any) -> _models.IngestionDefinition: + """Get the definition of an ingestion. - :param collection_id: Unique identifier for the STAC collection. Required. + :param collection_id: Catalog collection id. Required. :type collection_id: str - :param body: Tile settings configuration to be updated. Is one of the following types: - TileSettings, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.TileSettings or JSON or IO[bytes] - :return: TileSettings. The TileSettings is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileSettings + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7306,24 +11070,15 @@ def replace_tile_settings( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TileSettings] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.IngestionDefinition] = kwargs.pop("cls", None) - _request = build_stac_replace_tile_settings_request( + _request = build_ingestion_get_request( collection_id=collection_id, - content_type=content_type, + ingestion_id=ingestion_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7332,6 +11087,7 @@ def replace_tile_settings( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7349,9 +11105,9 @@ def replace_tile_settings( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.TileSettings, response.json()) + deserialized = _deserialize(_models.IngestionDefinition, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7359,15 +11115,26 @@ def replace_tile_settings( return deserialized # type: ignore @distributed_trace - def get_conformance_class(self, **kwargs: Any) -> _models.StacConformanceClasses: - """Conformance Classes. - - Returns the STAC conformance classes. + def list( + self, collection_id: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.IngestionDefinition"]: + """Get ingestions of a catalog. - :return: StacConformanceClasses. The StacConformanceClasses is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacConformanceClasses + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :keyword top: The number of items to return. Default value is None. + :paramtype top: int + :keyword skip: The number of items to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of IngestionDefinition + :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.IngestionDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IngestionDefinition]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7376,72 +11143,199 @@ def get_conformance_class(self, **kwargs: Any) -> _models.StacConformanceClasses } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.StacConformanceClasses] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_stac_get_conformance_class_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_ingestion_list_request( + collection_id=collection_id, + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IngestionDefinition], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacConformanceClasses, response.json()) + def get_next(next_link=None): + _request = prepare_request(next_link) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - return deserialized # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - @distributed_trace - def get_landing_page(self, **kwargs: Any) -> _models.StacLandingPage: - """Landing Page. + return pipeline_response - Return the STAC landing page. + return ItemPaged(get_next, extract_data) - :return: StacLandingPage. The StacLandingPage is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacLandingPage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + @overload + def update( + self, + collection_id: str, + ingestion_id: str, + body: _models.IngestionDefinition, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.IngestionDefinition: + """Update an existing ingestion. - _headers = kwargs.pop("headers", {}) or {} + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :param body: Ingestion properties to update. Required. + :type body: ~azure.planetarycomputer.models.IngestionDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + collection_id: str, + ingestion_id: str, + body: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.IngestionDefinition: + """Update an existing ingestion. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :param body: Ingestion properties to update. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + collection_id: str, + ingestion_id: str, + body: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.IngestionDefinition: + """Update an existing ingestion. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :param body: Ingestion properties to update. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + collection_id: str, + ingestion_id: str, + body: Union[_models.IngestionDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.IngestionDefinition: + """Update an existing ingestion. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param ingestion_id: Ingestion id. Required. + :type ingestion_id: str + :param body: Ingestion properties to update. Is one of the following types: + IngestionDefinition, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.IngestionDefinition or JSON or IO[bytes] + :return: IngestionDefinition. The IngestionDefinition is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.StacLandingPage] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) + cls: ClsType[_models.IngestionDefinition] = kwargs.pop("cls", None) - _request = build_stac_get_landing_page_request( + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ingestion_update_request( + collection_id=collection_id, + ingestion_id=ingestion_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7450,6 +11344,7 @@ def get_landing_page(self, **kwargs: Any) -> _models.StacLandingPage: } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7467,18 +11362,76 @@ def get_landing_page(self, **kwargs: Any) -> _models.StacLandingPage: raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.StacLandingPage, response.json()) + deserialized = _deserialize(_models.IngestionDefinition, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_item_initial( - self, collection_id: str, body: Union[_models.StacItemOrStacItemCollection, JSON, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: + @overload + def create_source( + self, body: _models.IngestionSource, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionSource: + """Create a new ingestion source in a geo-catalog. + + :param body: Definition of the ingestion source. Required. + :type body: ~azure.planetarycomputer.models.IngestionSource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_source( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionSource: + """Create a new ingestion source in a geo-catalog. + + :param body: Definition of the ingestion source. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_source( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionSource: + """Create a new ingestion source in a geo-catalog. + + :param body: Definition of the ingestion source. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_source( + self, body: Union[_models.IngestionSource, JSON, IO[bytes]], **kwargs: Any + ) -> _models.IngestionSource: + """Create a new ingestion source in a geo-catalog. + + :param body: Definition of the ingestion source. Is one of the following types: + IngestionSource, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.IngestionSource or JSON or IO[bytes] + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7491,7 +11444,7 @@ def _create_item_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.IngestionSource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -7500,8 +11453,7 @@ def _create_item_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_create_item_request( - collection_id=collection_id, + _request = build_ingestion_create_source_request( content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7513,26 +11465,30 @@ def _create_item_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = True + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) response_headers = {} response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IngestionSource, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -7540,175 +11496,74 @@ def _create_item_initial( return deserialized # type: ignore @overload - def begin_create_item( - self, - collection_id: str, - body: _models.StacItemOrStacItemCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Create a new STAC item or a set of items in a collection. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: STAC Item or StacItemCollection - - Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. + def replace_source( + self, id: str, body: _models.IngestionSource, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionSource: + """Update an existing ingestion source in a geo-catalog. - **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. - It includes metadata such as geometry, datetime, and links to related assets. - Example: A satellite image with its metadata. + :param id: Ingestion source id. Required. + :type id: str + :param body: Definition of the ingestion source. Required. + :type body: ~azure.planetarycomputer.models.IngestionSource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource + :raises ~azure.core.exceptions.HttpResponseError: + """ - **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. - It is used to group multiple related Items together, such as a collection of satellite images. + @overload + def replace_source( + self, id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionSource: + """Update an existing ingestion source in a geo-catalog. - This union allows the request body to accept either a single Item or a collection of Items. - Required. - :type body: ~azure.planetarycomputer.models.StacItemOrStacItemCollection + :param id: Ingestion source id. Required. + :type id: str + :param body: Definition of the ingestion source. Required. + :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_item( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Create a new STAC item or a set of items in a collection. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: STAC Item or StacItemCollection - - Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. - - **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. - It includes metadata such as geometry, datetime, and links to related assets. - Example: A satellite image with its metadata. - - **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. - It is used to group multiple related Items together, such as a collection of satellite images. - - This union allows the request body to accept either a single Item or a collection of Items. - Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_item( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Create a new STAC item or a set of items in a collection. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: STAC Item or StacItemCollection - - Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. - - **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. - It includes metadata such as geometry, datetime, and links to related assets. - Example: A satellite image with its metadata. - - **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. - It is used to group multiple related Items together, such as a collection of satellite images. + def replace_source( + self, id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.IngestionSource: + """Update an existing ingestion source in a geo-catalog. - This union allows the request body to accept either a single Item or a collection of Items. - Required. + :param id: Ingestion source id. Required. + :type id: str + :param body: Definition of the ingestion source. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_item( - self, collection_id: str, body: Union[_models.StacItemOrStacItemCollection, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Create a new STAC item or a set of items in a collection. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param body: STAC Item or StacItemCollection - - Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. - - **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. - It includes metadata such as geometry, datetime, and links to related assets. - Example: A satellite image with its metadata. - - **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. - It is used to group multiple related Items together, such as a collection of satellite images. + def replace_source( + self, id: str, body: Union[_models.IngestionSource, JSON, IO[bytes]], **kwargs: Any + ) -> _models.IngestionSource: + """Update an existing ingestion source in a geo-catalog. - This union allows the request body to accept either a single Item or a collection of Items. Is - one of the following types: StacItemOrStacItemCollection, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacItemOrStacItemCollection or JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param id: Ingestion source id. Required. + :type id: str + :param body: Definition of the ingestion source. Is one of the following types: + IngestionSource, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.IngestionSource or JSON or IO[bytes] + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_item_initial( - collection_id=collection_id, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _create_or_replace_item_initial( - self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7721,7 +11576,7 @@ def _create_or_replace_item_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.IngestionSource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -7730,9 +11585,8 @@ def _create_or_replace_item_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_create_or_replace_item_request( - collection_id=collection_id, - item_id=item_id, + _request = build_ingestion_replace_source_request( + id=id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7744,168 +11598,94 @@ def _create_or_replace_item_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = True + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) response_headers = {} response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IngestionSource, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def begin_create_or_replace_item( - self, - collection_id: str, - item_id: str, - body: _models.StacItem, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Create or replace a STAC item in a collection. + @distributed_trace + def delete_source(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an ingestion source from a geo-catalog. - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Required. - :type body: ~azure.planetarycomputer.models.StacItem - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param id: Ingestion source id. Required. + :type id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def begin_create_or_replace_item( - self, collection_id: str, item_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Create or replace a STAC item in a collection. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + cls: ClsType[None] = kwargs.pop("cls", None) - @overload - def begin_create_or_replace_item( - self, - collection_id: str, - item_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Create or replace a STAC item in a collection. + _request = build_ingestion_delete_source_request( + id=id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - @distributed_trace - def begin_create_or_replace_item( - self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Create or replace a STAC item in a collection. + response = pipeline_response.http_response - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Is one of the following types: StacItem, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacItem or JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_replace_item_initial( - collection_id=collection_id, - item_id=item_id, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } + if cls: + return cls(pipeline_response, None, {}) # type: ignore - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @distributed_trace + def get_source(self, id: str, **kwargs: Any) -> _models.IngestionSource: + """Get an ingestion source in a geo-catalog. - def _delete_item_initial(self, collection_id: str, item_id: str, **kwargs: Any) -> Iterator[bytes]: + :param id: Ingestion source id. Required. + :type id: str + :return: IngestionSource. The IngestionSource is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.IngestionSource + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7917,11 +11697,10 @@ def _delete_item_initial(self, collection_id: str, item_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.IngestionSource] = kwargs.pop("cls", None) - _request = build_stac_delete_item_request( - collection_id=collection_id, - item_id=item_id, + _request = build_ingestion_get_source_request( + id=id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7931,100 +11710,139 @@ def _delete_item_initial(self, collection_id: str, item_id: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = True + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IngestionSource, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def begin_delete_item(self, collection_id: str, item_id: str, **kwargs: Any) -> LROPoller[None]: - """Delete a STAC item from a collection. + def list_sources( + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.IngestionSourceSummary"]: + """Get ingestion sources in a geo-catalog. - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :keyword top: The number of items to return. Default value is None. + :paramtype top: int + :keyword skip: The number of items to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of IngestionSourceSummary + :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.IngestionSourceSummary] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_item_initial( - collection_id=collection_id, - item_id=item_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + cls: ClsType[List[_models.IngestionSourceSummary]] = kwargs.pop("cls", None) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } + error_map.update(kwargs.pop("error_map", {}) or {}) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + def prepare_request(next_link=None): + if not next_link: + + _request = build_ingestion_list_sources_request( + top=top, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IngestionSourceSummary], + deserialized.get("value", []), ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace - def get_item(self, collection_id: str, item_id: str, **kwargs: Any) -> _models.StacItem: - """Fetch a single STAC Item. + def list_managed_identities(self, **kwargs: Any) -> ItemPaged["_models.ManagedIdentityMetadata"]: + """Get all managed identities with access to storage accounts configured for a geo-catalog. - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :return: StacItem. The StacItem is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItem + :return: An iterator like instance of ManagedIdentityMetadata + :rtype: ~azure.core.paging.ItemPaged[~azure.planetarycomputer.models.ManagedIdentityMetadata] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedIdentityMetadata]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8033,129 +11851,136 @@ def get_item(self, collection_id: str, item_id: str, **kwargs: Any) -> _models.S } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[_models.StacItem] = kwargs.pop("cls", None) + _request = build_ingestion_list_managed_identities_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_stac_get_item_request( - collection_id=collection_id, - item_id=item_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return deserialized # type: ignore + return _request - @distributed_trace - def get_item_collection( - self, - collection_id: str, - *, - limit: Optional[int] = None, - bounding_box: Optional[List[str]] = None, - datetime: Optional[str] = None, - **kwargs: Any - ) -> _models.StacItemCollection: - """Fetch features of the feature collection with id ``collectionId``. + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedIdentityMetadata], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - Every feature in a dataset belongs to a collection. A dataset may - consist of multiple feature collections. A feature collection is often a - collection of features of a similar type, based on a common schema. + def get_next(next_link=None): + _request = prepare_request(next_link) - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :keyword limit: The optional limit parameter recommends the number of items that should be - present in the response document. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - If the limit parameter value is greater than advertised limit maximum, the server must return - the - maximum possible number of items, rather than responding with an error. + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - Only items are counted that are on the first level of the collection in the response document. - Nested objects contained within the explicitly requested items must not be counted. + return pipeline_response - Minimum = 1. Maximum = 10000. Default = 10. Default value is None. - :paramtype limit: int - :keyword bounding_box: Only features that have a geometry that intersects the bounding box are - selected. - The bounding box is provided as four or six numbers, depending on whether the - coordinate reference system includes a vertical axis (height or depth): + return ItemPaged(get_next, extract_data) +class StacOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. - * Lower left corner, coordinate axis 1 - * Lower left corner, coordinate axis 2 - * Minimum value, coordinate axis 3 (optional) - * Upper right corner, coordinate axis 1 - * Upper right corner, coordinate axis 2 - * Maximum value, coordinate axis 3 (optional) + Instead, you should access the following operations through + :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s + :attr:`stac` attribute. + """ - The coordinate reference system of the values is WGS 84 longitude/latitude - (`http://www.opengis.net/def/crs/OGC/1.3/CRS84 - `_). + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PlanetaryComputerProClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - For WGS 84 longitude/latitude the values are in most cases the sequence of - minimum longitude, minimum latitude, maximum longitude and maximum latitude. - However, in cases where the box spans the antimeridian the first value - (west-most box edge) is larger than the third value (east-most box edge). + @overload + def create_collection_asset( + self, collection_id: str, body: _models.StacAssetData, **kwargs: Any + ) -> _models.StacCollection: + """Create Collection Asset. - If the vertical axis is included, the third and the sixth number are - the bottom and the top of the 3-dimensional bounding box. + Create a new asset in the Collection metadata and write the associated file to managed storage. - If a feature has multiple spatial geometry properties, it is the decision of the - server whether only a single spatial geometry property is used to determine - the extent or all relevant geometries. Default value is None. - :paramtype bounding_box: list[str] - :keyword datetime: Either a date-time or an interval, open or closed. Date and time expressions - adhere to RFC 3339. Open intervals are expressed using double-dots. + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param body: Multi-part form data. Required. + :type body: ~azure.planetarycomputer.models.StacAssetData + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ - Examples: + @overload + def create_collection_asset(self, collection_id: str, body: JSON, **kwargs: Any) -> _models.StacCollection: + """Create Collection Asset. + Create a new asset in the Collection metadata and write the associated file to managed storage. + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param body: Multi-part form data. Required. + :type body: JSON + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ - * A date-time: "2018-02-12T23:20:50Z" - * A closed interval: "2018-02-12T00:00:00Z/2018-03-18T12:31:12Z" - * Open intervals: "2018-02-12T00:00:00Z/.." or "../2018-03-18T12:31:12Z" + @distributed_trace + def create_collection_asset( + self, collection_id: str, body: Union[_models.StacAssetData, JSON], **kwargs: Any + ) -> _models.StacCollection: + """Create Collection Asset. - Only features that have a temporal property that intersects the value of - ``datetime`` are selected. + Create a new asset in the Collection metadata and write the associated file to managed storage. - If a feature has multiple temporal properties, it is the decision of the - server whether only a single temporal property is used to determine - the extent or all relevant temporal properties. Default value is None. - :paramtype datetime: str - :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemCollection + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param body: Multi-part form data. Is either a StacAssetData type or a JSON type. Required. + :type body: ~azure.planetarycomputer.models.StacAssetData or JSON + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8169,14 +11994,17 @@ def get_item_collection( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.StacItemCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) - _request = build_stac_get_item_collection_request( + _body = body.as_dict() if isinstance(body, _Model) else body + _file_fields: list[str] = ["file"] + _data_fields: list[str] = ["data"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_stac_create_collection_asset_request( collection_id=collection_id, - limit=limit, - bounding_box=bounding_box, - datetime=datetime, api_version=self._config.api_version, + files=_files, headers=_headers, params=_params, ) @@ -8185,6 +12013,7 @@ def get_item_collection( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8192,7 +12021,7 @@ def get_item_collection( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -8202,18 +12031,71 @@ def get_item_collection( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.StacItemCollection, response.json()) + deserialized = _deserialize(_models.StacCollection, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _update_item_initial( - self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: + @overload + def replace_collection_asset( + self, collection_id: str, asset_id: str, body: _models.StacAssetData, **kwargs: Any + ) -> _models.StacCollection: + """Update Collection Asset. + + Update an existing asset in a given collection. + + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param asset_id: STAC Asset ID. Required. + :type asset_id: str + :param body: Multi-part form data. Required. + :type body: ~azure.planetarycomputer.models.StacAssetData + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_collection_asset( + self, collection_id: str, asset_id: str, body: JSON, **kwargs: Any + ) -> _models.StacCollection: + """Update Collection Asset. + + Update an existing asset in a given collection. + + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param asset_id: STAC Asset ID. Required. + :type asset_id: str + :param body: Multi-part form data. Required. + :type body: JSON + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_collection_asset( + self, collection_id: str, asset_id: str, body: Union[_models.StacAssetData, JSON], **kwargs: Any + ) -> _models.StacCollection: + """Update Collection Asset. + + Update an existing asset in a given collection. + + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param asset_id: STAC Asset ID. Required. + :type asset_id: str + :param body: Multi-part form data. Is either a StacAssetData type or a JSON type. Required. + :type body: ~azure.planetarycomputer.models.StacAssetData or JSON + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8222,25 +12104,87 @@ def _update_item_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) - content_type = content_type or "application/merge-patch+json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + _body = body.as_dict() if isinstance(body, _Model) else body + _file_fields: list[str] = ["file"] + _data_fields: list[str] = ["data"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_stac_replace_collection_asset_request( + collection_id=collection_id, + asset_id=asset_id, + api_version=self._config.api_version, + files=_files, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + deserialized = _deserialize(_models.StacCollection, response.json()) - _request = build_stac_update_item_request( + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_collection_asset(self, collection_id: str, asset_id: str, **kwargs: Any) -> _models.StacCollection: + """Delete Collection Asset. + + Delete an asset from a given collection. + + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :param asset_id: STAC Asset ID. Required. + :type asset_id: str + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + + _request = build_stac_delete_collection_asset_request( collection_id=collection_id, - item_id=item_id, - content_type=content_type, + asset_id=asset_id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -8249,253 +12193,171 @@ def _update_item_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = True + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacCollection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_configuration(self, collection_id: str, **kwargs: Any) -> _models.UserCollectionSettings: + """Get Config. + + Get the complete user configuration for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :return: UserCollectionSettings. The UserCollectionSettings is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.UserCollectionSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UserCollectionSettings] = kwargs.pop("cls", None) + + _request = build_stac_get_collection_configuration_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.UserCollectionSettings, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_update_item( - self, - collection_id: str, - item_id: str, - body: _models.StacItem, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> LROPoller[None]: - """Update a STAC item in a collection. + def add_mosaic( + self, collection_id: str, body: _models.StacMosaic, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacMosaic: + """Add Collection Mosaic. - :param collection_id: Catalog collection id. Required. + Add a mosaic definition to a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Required. - :type body: ~azure.planetarycomputer.models.StacItem + :param body: Mosaic definition to be created or updated. Required. + :type body: ~azure.planetarycomputer.models.StacMosaic :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_item( - self, - collection_id: str, - item_id: str, - body: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> LROPoller[None]: - """Update a STAC item in a collection. + def add_mosaic( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacMosaic: + """Add Collection Mosaic. - :param collection_id: Catalog collection id. Required. + Add a mosaic definition to a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Required. + :param body: Mosaic definition to be created or updated. Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_item( - self, - collection_id: str, - item_id: str, - body: IO[bytes], - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> LROPoller[None]: - """Update a STAC item in a collection. + def add_mosaic( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacMosaic: + """Add Collection Mosaic. - :param collection_id: Catalog collection id. Required. + Add a mosaic definition to a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Required. + :param body: Mosaic definition to be created or updated. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_item( - self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Update a STAC item in a collection. - - :param collection_id: Catalog collection id. Required. - :type collection_id: str - :param item_id: STAC Item id. Required. - :type item_id: str - :param body: STAC Item. Is one of the following types: StacItem, JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacItem or JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_item_initial( - collection_id=collection_id, - item_id=item_id, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def create_queryables( - self, - collection_id: str, - body: List[_models.StacQueryable], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> List[_models.StacQueryable]: - """Set Collection Queryables. - - Set queryables for a collection given a list of queryable definitions. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Request queryable definition body. Required. - :type body: list[~azure.planetarycomputer.models.StacQueryable] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: list of StacQueryable - :rtype: list[~azure.planetarycomputer.models.StacQueryable] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_queryables( - self, collection_id: str, body: List[JSON], *, content_type: str = "application/json", **kwargs: Any - ) -> List[_models.StacQueryable]: - """Set Collection Queryables. - - Set queryables for a collection given a list of queryable definitions. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Request queryable definition body. Required. - :type body: list[JSON] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: list of StacQueryable - :rtype: list[~azure.planetarycomputer.models.StacQueryable] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_queryables( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> List[_models.StacQueryable]: - """Set Collection Queryables. - - Set queryables for a collection given a list of queryable definitions. - - :param collection_id: Unique identifier for the STAC collection. Required. - :type collection_id: str - :param body: Request queryable definition body. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: list of StacQueryable - :rtype: list[~azure.planetarycomputer.models.StacQueryable] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_queryables( - self, collection_id: str, body: Union[List[_models.StacQueryable], List[JSON], IO[bytes]], **kwargs: Any - ) -> List[_models.StacQueryable]: - """Set Collection Queryables. + def add_mosaic( + self, collection_id: str, body: Union[_models.StacMosaic, JSON, IO[bytes]], **kwargs: Any + ) -> _models.StacMosaic: + """Add Collection Mosaic. - Set queryables for a collection given a list of queryable definitions. + Add a mosaic definition to a given collection. :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param body: Request queryable definition body. Is one of the following types: [StacQueryable], - [JSON], IO[bytes] Required. - :type body: list[~azure.planetarycomputer.models.StacQueryable] or list[JSON] or IO[bytes] - :return: list of StacQueryable - :rtype: list[~azure.planetarycomputer.models.StacQueryable] + :param body: Mosaic definition to be created or updated. Is one of the following types: + StacMosaic, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacMosaic or JSON or IO[bytes] + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8510,7 +12372,7 @@ def create_queryables( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.StacQueryable]] = kwargs.pop("cls", None) + cls: ClsType[_models.StacMosaic] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -8519,7 +12381,7 @@ def create_queryables( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_create_queryables_request( + _request = build_stac_add_mosaic_request( collection_id=collection_id, content_type=content_type, api_version=self._config.api_version, @@ -8532,6 +12394,7 @@ def create_queryables( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8549,9 +12412,9 @@ def create_queryables( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(List[_models.StacQueryable], response.json()) + deserialized = _deserialize(_models.StacMosaic, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8559,110 +12422,100 @@ def create_queryables( return deserialized # type: ignore @overload - def replace_queryable( + def replace_mosaic( self, collection_id: str, - queryable_name: str, - body: _models.StacQueryable, + mosaic_id: str, + body: _models.StacMosaic, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacQueryable: - """Update Collection Queryables. + ) -> _models.StacMosaic: + """Update Collection Mosaic. - Updates a queryable given a queryable definition and corresponding collection id. + Update a mosaic definition from a given collection. :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param queryable_name: Name of the queryable property to operate on. Required. - :type queryable_name: str - :param body: Request queryable definition body. Required. - :type body: ~azure.planetarycomputer.models.StacQueryable + :param mosaic_id: Unique identifier for the mosaic configuration. Required. + :type mosaic_id: str + :param body: Mosaic definition to be created or updated. Required. + :type body: ~azure.planetarycomputer.models.StacMosaic :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: StacQueryable. The StacQueryable is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacQueryable + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def replace_queryable( - self, - collection_id: str, - queryable_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacQueryable: - """Update Collection Queryables. + def replace_mosaic( + self, collection_id: str, mosaic_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacMosaic: + """Update Collection Mosaic. - Updates a queryable given a queryable definition and corresponding collection id. + Update a mosaic definition from a given collection. :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param queryable_name: Name of the queryable property to operate on. Required. - :type queryable_name: str - :param body: Request queryable definition body. Required. + :param mosaic_id: Unique identifier for the mosaic configuration. Required. + :type mosaic_id: str + :param body: Mosaic definition to be created or updated. Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: StacQueryable. The StacQueryable is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacQueryable + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def replace_queryable( + def replace_mosaic( self, collection_id: str, - queryable_name: str, + mosaic_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.StacQueryable: - """Update Collection Queryables. + ) -> _models.StacMosaic: + """Update Collection Mosaic. - Updates a queryable given a queryable definition and corresponding collection id. + Update a mosaic definition from a given collection. :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param queryable_name: Name of the queryable property to operate on. Required. - :type queryable_name: str - :param body: Request queryable definition body. Required. + :param mosaic_id: Unique identifier for the mosaic configuration. Required. + :type mosaic_id: str + :param body: Mosaic definition to be created or updated. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: StacQueryable. The StacQueryable is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacQueryable + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def replace_queryable( - self, - collection_id: str, - queryable_name: str, - body: Union[_models.StacQueryable, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.StacQueryable: - """Update Collection Queryables. + def replace_mosaic( + self, collection_id: str, mosaic_id: str, body: Union[_models.StacMosaic, JSON, IO[bytes]], **kwargs: Any + ) -> _models.StacMosaic: + """Update Collection Mosaic. - Updates a queryable given a queryable definition and corresponding collection id. + Update a mosaic definition from a given collection. :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param queryable_name: Name of the queryable property to operate on. Required. - :type queryable_name: str - :param body: Request queryable definition body. Is one of the following types: StacQueryable, - JSON, IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.StacQueryable or JSON or IO[bytes] - :return: StacQueryable. The StacQueryable is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacQueryable + :param mosaic_id: Unique identifier for the mosaic configuration. Required. + :type mosaic_id: str + :param body: Mosaic definition to be created or updated. Is one of the following types: + StacMosaic, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacMosaic or JSON or IO[bytes] + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8677,7 +12530,7 @@ def replace_queryable( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacQueryable] = kwargs.pop("cls", None) + cls: ClsType[_models.StacMosaic] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -8686,9 +12539,9 @@ def replace_queryable( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_replace_queryable_request( + _request = build_stac_replace_mosaic_request( collection_id=collection_id, - queryable_name=queryable_name, + mosaic_id=mosaic_id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8700,6 +12553,7 @@ def replace_queryable( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8717,9 +12571,9 @@ def replace_queryable( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.StacQueryable, response.json()) + deserialized = _deserialize(_models.StacMosaic, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8727,17 +12581,17 @@ def replace_queryable( return deserialized # type: ignore @distributed_trace - def delete_queryable( # pylint: disable=inconsistent-return-statements - self, collection_id: str, queryable_name: str, **kwargs: Any + def delete_mosaic( # pylint: disable=inconsistent-return-statements + self, collection_id: str, mosaic_id: str, **kwargs: Any ) -> None: - """Delete Queryables. + """Delete Collection Mosaic. - Delete queryables by name for specified collection. + Delete a mosaic definition from a given collection. :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :param queryable_name: Name of the queryable property to operate on. Required. - :type queryable_name: str + :param mosaic_id: Unique identifier for the mosaic configuration. Required. + :type mosaic_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -8755,9 +12609,9 @@ def delete_queryable( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_stac_delete_queryable_request( + _request = build_stac_delete_mosaic_request( collection_id=collection_id, - queryable_name=queryable_name, + mosaic_id=mosaic_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8782,14 +12636,17 @@ def delete_queryable( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsResponse: - """Queryables. + def get_mosaic(self, collection_id: str, mosaic_id: str, **kwargs: Any) -> _models.StacMosaic: + """Get Collection Mosaic. - List all queryables in the GeoCatalog instance. + Get a mosaic definition from a given collection. - :return: QueryableDefinitionsResponse. The QueryableDefinitionsResponse is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.QueryableDefinitionsResponse + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param mosaic_id: Unique identifier for the mosaic configuration. Required. + :type mosaic_id: str + :return: StacMosaic. The StacMosaic is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacMosaic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8803,9 +12660,11 @@ def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsResponse _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.QueryableDefinitionsResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.StacMosaic] = kwargs.pop("cls", None) - _request = build_stac_list_queryables_request( + _request = build_stac_get_mosaic_request( + collection_id=collection_id, + mosaic_id=mosaic_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8815,6 +12674,7 @@ def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsResponse } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8832,9 +12692,9 @@ def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsResponse raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.QueryableDefinitionsResponse, response.json()) + deserialized = _deserialize(_models.StacMosaic, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8842,16 +12702,15 @@ def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsResponse return deserialized # type: ignore @distributed_trace - def get_collection_queryables(self, collection_id: str, **kwargs: Any) -> _models.QueryableDefinitionsResponse: - """Collection Queryables. + def list_mosaics(self, collection_id: str, **kwargs: Any) -> List[_models.StacMosaic]: + """Get Collection Mosaics. - List all queryables in a given collection. + Get the mosaic definitions for a given collection. - :param collection_id: Collection ID. Required. + :param collection_id: Unique identifier for the STAC collection. Required. :type collection_id: str - :return: QueryableDefinitionsResponse. The QueryableDefinitionsResponse is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.QueryableDefinitionsResponse + :return: list of StacMosaic + :rtype: list[~azure.planetarycomputer.models.StacMosaic] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8865,9 +12724,9 @@ def get_collection_queryables(self, collection_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.QueryableDefinitionsResponse] = kwargs.pop("cls", None) + cls: ClsType[List[_models.StacMosaic]] = kwargs.pop("cls", None) - _request = build_stac_get_collection_queryables_request( + _request = build_stac_list_mosaics_request( collection_id=collection_id, api_version=self._config.api_version, headers=_headers, @@ -8878,6 +12737,7 @@ def get_collection_queryables(self, collection_id: str, **kwargs: Any) -> _model } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -8895,127 +12755,18 @@ def get_collection_queryables(self, collection_id: str, **kwargs: Any) -> _model raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.QueryableDefinitionsResponse, response.json()) + deserialized = _deserialize(List[_models.StacMosaic], response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def search( - self, - body: _models.StacSearchParameters, - *, - sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, - duration_in_minutes: Optional[int] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacItemCollection: - """Search. - - STAC search operation. - - :param body: Request body. Required. - :type body: ~azure.planetarycomputer.models.StacSearchParameters - :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and - "false". Default value is None. - :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode - :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. - :paramtype duration_in_minutes: int - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def search( - self, - body: JSON, - *, - sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, - duration_in_minutes: Optional[int] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacItemCollection: - """Search. - - STAC search operation. - - :param body: Request body. Required. - :type body: JSON - :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and - "false". Default value is None. - :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode - :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. - :paramtype duration_in_minutes: int - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def search( - self, - body: IO[bytes], - *, - sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, - duration_in_minutes: Optional[int] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacItemCollection: - """Search. - - STAC search operation. - - :param body: Request body. Required. - :type body: IO[bytes] - :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and - "false". Default value is None. - :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode - :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. - :paramtype duration_in_minutes: int - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def search( - self, - body: Union[_models.StacSearchParameters, JSON, IO[bytes]], - *, - sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, - duration_in_minutes: Optional[int] = None, - **kwargs: Any - ) -> _models.StacItemCollection: - """Search. - - STAC search operation. - - :param body: Request body. Is one of the following types: StacSearchParameters, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.StacSearchParameters or JSON or IO[bytes] - :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and - "false". Default value is None. - :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode - :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. - :paramtype duration_in_minutes: int - :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemCollection - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _create_collection_initial( + self, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9028,7 +12779,7 @@ def search( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacItemCollection] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -9037,9 +12788,7 @@ def search( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_stac_search_request( - sign=sign, - duration_in_minutes=duration_in_minutes, + _request = build_stac_create_collection_request( content_type=content_type, api_version=self._config.api_version, content=_content, @@ -9051,80 +12800,245 @@ def search( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacItemCollection, response.json()) + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + def begin_create_collection( + self, body: _models.StacCollection, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Create Collection. -class DataOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s - :attr:`data` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: PlanetaryComputerProClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get_tile_matrix_definitions(self, tile_matrix_set_id: str, **kwargs: Any) -> _models.TileMatrixSet: - """Matrix Definition. - - Return Matrix Definition. + Create a new collection in the GeoCatalog instance. - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str - :return: TileMatrixSet. The TileMatrixSet is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileMatrixSet + :param body: Request collection body. Required. + :type body: ~azure.planetarycomputer.models.StacCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + @overload + def begin_create_collection( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Create Collection. - cls: ClsType[_models.TileMatrixSet] = kwargs.pop("cls", None) + Create a new collection in the GeoCatalog instance. - _request = build_data_get_tile_matrix_definitions_request( - tile_matrix_set_id=tile_matrix_set_id, + :param body: Request collection body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_collection( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Create Collection. + + Create a new collection in the GeoCatalog instance. + + :param body: Request collection body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_collection( + self, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Create Collection. + + Create a new collection in the GeoCatalog instance. + + :param body: Request collection body. Is one of the following types: StacCollection, JSON, + IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacCollection or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_collection_initial( + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def replace_collection( + self, collection_id: str, body: _models.StacCollection, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacCollection: + """Replace Collection. + + Replace an existing collection in the GeoCatalog instance. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Request collection body. Required. + :type body: ~azure.planetarycomputer.models.StacCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_collection( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacCollection: + """Replace Collection. + + Replace an existing collection in the GeoCatalog instance. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Request collection body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_collection( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.StacCollection: + """Replace Collection. + + Replace an existing collection in the GeoCatalog instance. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Request collection body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_collection( + self, collection_id: str, body: Union[_models.StacCollection, JSON, IO[bytes]], **kwargs: Any + ) -> _models.StacCollection: + """Replace Collection. + + Replace an existing collection in the GeoCatalog instance. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: Request collection body. Is one of the following types: StacCollection, JSON, + IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacCollection or JSON or IO[bytes] + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_replace_collection_request( + collection_id=collection_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -9133,6 +13047,7 @@ def get_tile_matrix_definitions(self, tile_matrix_set_id: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9150,23 +13065,19065 @@ def get_tile_matrix_definitions(self, tile_matrix_set_id: str, **kwargs: Any) -> raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.TileMatrixSet, response.json()) + deserialized = _deserialize(_models.StacCollection, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + def _delete_collection_initial(self, collection_id: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_stac_delete_collection_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @distributed_trace - def list_tile_matrices(self, **kwargs: Any) -> List[str]: - """Matrix List. + def begin_delete_collection(self, collection_id: str, **kwargs: Any) -> LROPoller[None]: + """Delete Collection. - Return Matrix List. + Delete a collection in the GeoCatalog instance. - :return: list of str - :rtype: list[str] + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_collection_initial( + collection_id=collection_id, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get_collection( + self, + collection_id: str, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> _models.StacCollection: + """Get Collection. + + Get a collection in the GeoCatalog instance. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :return: StacCollection. The StacCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacCollection] = kwargs.pop("cls", None) + + _request = build_stac_get_collection_request( + collection_id=collection_id, + sign=sign, + duration_in_minutes=duration_in_minutes, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacCollection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collections( + self, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> _models.StacCatalogCollections: + """Get Collections. + + List all collections in the GeoCatalog instance. + + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :return: StacCatalogCollections. The StacCatalogCollections is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacCatalogCollections + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacCatalogCollections] = kwargs.pop("cls", None) + + _request = build_stac_get_collections_request( + sign=sign, + duration_in_minutes=duration_in_minutes, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacCatalogCollections, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_partition_type(self, collection_id: str, **kwargs: Any) -> _models.PartitionType: + """Get Partitiontype. + + Get the partitiontype for a GeoCatalog Collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :return: PartitionType. The PartitionType is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.PartitionType + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PartitionType] = kwargs.pop("cls", None) + + _request = build_stac_get_partition_type_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PartitionType, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def replace_partition_type( + self, collection_id: str, body: _models.PartitionType, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Create Partitiontype. + + Updates partition type for a GeoCatalog Collection. This will + determine the partitioning scheme for items within the database, + and can only be set before any items are loaded. + + Ideal partitioning schemes result in partitions of roughly 100k items each. + + The default partitioning scheme is "none" which does not partition items. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Partition type configuration determining how items are partitioned in storage. + Required. + :type body: ~azure.planetarycomputer.models.PartitionType + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_partition_type( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Create Partitiontype. + + Updates partition type for a GeoCatalog Collection. This will + determine the partitioning scheme for items within the database, + and can only be set before any items are loaded. + + Ideal partitioning schemes result in partitions of roughly 100k items each. + + The default partitioning scheme is "none" which does not partition items. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Partition type configuration determining how items are partitioned in storage. + Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_partition_type( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Create Partitiontype. + + Updates partition type for a GeoCatalog Collection. This will + determine the partitioning scheme for items within the database, + and can only be set before any items are loaded. + + Ideal partitioning schemes result in partitions of roughly 100k items each. + + The default partitioning scheme is "none" which does not partition items. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Partition type configuration determining how items are partitioned in storage. + Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_partition_type( # pylint: disable=inconsistent-return-statements + self, collection_id: str, body: Union[_models.PartitionType, JSON, IO[bytes]], **kwargs: Any + ) -> None: + """Create Partitiontype. + + Updates partition type for a GeoCatalog Collection. This will + determine the partitioning scheme for items within the database, + and can only be set before any items are loaded. + + Ideal partitioning schemes result in partitions of roughly 100k items each. + + The default partitioning scheme is "none" which does not partition items. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Partition type configuration determining how items are partitioned in storage. Is + one of the following types: PartitionType, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.PartitionType or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_replace_partition_type_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def create_render_option( + self, collection_id: str, body: _models.RenderOption, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RenderOption: + """Add Collection Render Option. + + Add a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Render option configuration to be created or updated. Required. + :type body: ~azure.planetarycomputer.models.RenderOption + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_render_option( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RenderOption: + """Add Collection Render Option. + + Add a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Render option configuration to be created or updated. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_render_option( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RenderOption: + """Add Collection Render Option. + + Add a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Render option configuration to be created or updated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_render_option( + self, collection_id: str, body: Union[_models.RenderOption, JSON, IO[bytes]], **kwargs: Any + ) -> _models.RenderOption: + """Add Collection Render Option. + + Add a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Render option configuration to be created or updated. Is one of the following + types: RenderOption, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.RenderOption or JSON or IO[bytes] + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RenderOption] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_create_render_option_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RenderOption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def replace_render_option( + self, + collection_id: str, + render_option_id: str, + body: _models.RenderOption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RenderOption: + """Update Collection Render Option. + + Update a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param render_option_id: Unique identifier for the render option. Required. + :type render_option_id: str + :param body: Render option configuration to be created or updated. Required. + :type body: ~azure.planetarycomputer.models.RenderOption + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_render_option( + self, + collection_id: str, + render_option_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RenderOption: + """Update Collection Render Option. + + Update a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param render_option_id: Unique identifier for the render option. Required. + :type render_option_id: str + :param body: Render option configuration to be created or updated. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_render_option( + self, + collection_id: str, + render_option_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RenderOption: + """Update Collection Render Option. + + Update a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param render_option_id: Unique identifier for the render option. Required. + :type render_option_id: str + :param body: Render option configuration to be created or updated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_render_option( + self, + collection_id: str, + render_option_id: str, + body: Union[_models.RenderOption, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.RenderOption: + """Update Collection Render Option. + + Update a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param render_option_id: Unique identifier for the render option. Required. + :type render_option_id: str + :param body: Render option configuration to be created or updated. Is one of the following + types: RenderOption, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.RenderOption or JSON or IO[bytes] + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RenderOption] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_replace_render_option_request( + collection_id=collection_id, + render_option_id=render_option_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RenderOption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_render_option( # pylint: disable=inconsistent-return-statements + self, collection_id: str, render_option_id: str, **kwargs: Any + ) -> None: + """Delete Collection Render Option. + + Delete a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param render_option_id: Unique identifier for the render option. Required. + :type render_option_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stac_delete_render_option_request( + collection_id=collection_id, + render_option_id=render_option_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_render_option(self, collection_id: str, render_option_id: str, **kwargs: Any) -> _models.RenderOption: + """Get Collection Render Option. + + Get a render option for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param render_option_id: Unique identifier for the render option. Required. + :type render_option_id: str + :return: RenderOption. The RenderOption is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.RenderOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RenderOption] = kwargs.pop("cls", None) + + _request = build_stac_get_render_option_request( + collection_id=collection_id, + render_option_id=render_option_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RenderOption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_render_options(self, collection_id: str, **kwargs: Any) -> List[_models.RenderOption]: + """Get Collection Render Options. + + Get all render options for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :return: list of RenderOption + :rtype: list[~azure.planetarycomputer.models.RenderOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RenderOption]] = kwargs.pop("cls", None) + + _request = build_stac_list_render_options_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.RenderOption], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_thumbnail(self, collection_id: str, **kwargs: Any) -> Iterator[bytes]: + """Get Collection Thumbnail. + + Get thumbnail for given collection. + + :param collection_id: STAC Collection ID. Required. + :type collection_id: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_stac_get_collection_thumbnail_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_settings(self, collection_id: str, **kwargs: Any) -> _models.TileSettings: + """Get Collection Tile Settings. + + Get the tile settings for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :return: TileSettings. The TileSettings is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSettings] = kwargs.pop("cls", None) + + _request = build_stac_get_tile_settings_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSettings, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def replace_tile_settings( + self, collection_id: str, body: _models.TileSettings, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TileSettings: + """Update Collection Tile Settings. + + Update the tile settings for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Tile settings configuration to be updated. Required. + :type body: ~azure.planetarycomputer.models.TileSettings + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TileSettings. The TileSettings is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_tile_settings( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TileSettings: + """Update Collection Tile Settings. + + Update the tile settings for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Tile settings configuration to be updated. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TileSettings. The TileSettings is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_tile_settings( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TileSettings: + """Update Collection Tile Settings. + + Update the tile settings for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Tile settings configuration to be updated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TileSettings. The TileSettings is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_tile_settings( + self, collection_id: str, body: Union[_models.TileSettings, JSON, IO[bytes]], **kwargs: Any + ) -> _models.TileSettings: + """Update Collection Tile Settings. + + Update the tile settings for a given collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Tile settings configuration to be updated. Is one of the following types: + TileSettings, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.TileSettings or JSON or IO[bytes] + :return: TileSettings. The TileSettings is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TileSettings] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_replace_tile_settings_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSettings, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_conformance_class(self, **kwargs: Any) -> _models.StacConformanceClasses: + """Conformance Classes. + + Returns the STAC conformance classes. + + :return: StacConformanceClasses. The StacConformanceClasses is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacConformanceClasses + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacConformanceClasses] = kwargs.pop("cls", None) + + _request = build_stac_get_conformance_class_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacConformanceClasses, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_landing_page(self, **kwargs: Any) -> _models.StacLandingPage: + """Landing Page. + + Return the STAC landing page. + + :return: StacLandingPage. The StacLandingPage is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacLandingPage + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacLandingPage] = kwargs.pop("cls", None) + + _request = build_stac_get_landing_page_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacLandingPage, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_item_initial( + self, collection_id: str, body: Union[_models.StacItemOrStacItemCollection, JSON, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_create_item_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_item( + self, + collection_id: str, + body: _models.StacItemOrStacItemCollection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Create a new STAC item or a set of items in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: STAC Item or StacItemCollection + + Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. + + **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. + It includes metadata such as geometry, datetime, and links to related assets. + Example: A satellite image with its metadata. + + **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. + It is used to group multiple related Items together, such as a collection of satellite images. + + This union allows the request body to accept either a single Item or a collection of Items. + Required. + :type body: ~azure.planetarycomputer.models.StacItemOrStacItemCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_item( + self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Create a new STAC item or a set of items in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: STAC Item or StacItemCollection + + Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. + + **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. + It includes metadata such as geometry, datetime, and links to related assets. + Example: A satellite image with its metadata. + + **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. + It is used to group multiple related Items together, such as a collection of satellite images. + + This union allows the request body to accept either a single Item or a collection of Items. + Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_item( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Create a new STAC item or a set of items in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: STAC Item or StacItemCollection + + Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. + + **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. + It includes metadata such as geometry, datetime, and links to related assets. + Example: A satellite image with its metadata. + + **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. + It is used to group multiple related Items together, such as a collection of satellite images. + + This union allows the request body to accept either a single Item or a collection of Items. + Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_item( + self, collection_id: str, body: Union[_models.StacItemOrStacItemCollection, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Create a new STAC item or a set of items in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param body: STAC Item or StacItemCollection + + Represents a STAC Item or StacItemCollection as defined by the STAC 1.0.0 standard. + + **Item**: A GeoJSON Feature that represents a single spatiotemporal asset. + It includes metadata such as geometry, datetime, and links to related assets. + Example: A satellite image with its metadata. + + **StacItemCollection**: A GeoJSON FeatureCollection that contains multiple Items. + It is used to group multiple related Items together, such as a collection of satellite images. + + This union allows the request body to accept either a single Item or a collection of Items. Is + one of the following types: StacItemOrStacItemCollection, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacItemOrStacItemCollection or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_item_initial( + collection_id=collection_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _replace_item_initial( + self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_replace_item_request( + collection_id=collection_id, + item_id=item_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_replace_item( + self, + collection_id: str, + item_id: str, + body: _models.StacItem, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Replace a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Required. + :type body: ~azure.planetarycomputer.models.StacItem + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_replace_item( + self, collection_id: str, item_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Replace a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_replace_item( + self, + collection_id: str, + item_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Replace a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_replace_item( + self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Replace a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Is one of the following types: StacItem, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacItem or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._replace_item_initial( + collection_id=collection_id, + item_id=item_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_item_initial(self, collection_id: str, item_id: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_stac_delete_item_request( + collection_id=collection_id, + item_id=item_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete_item(self, collection_id: str, item_id: str, **kwargs: Any) -> LROPoller[None]: + """Delete a STAC item from a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_item_initial( + collection_id=collection_id, + item_id=item_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get_item( + self, + collection_id: str, + item_id: str, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> _models.StacItem: + """Fetch a single STAC Item. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :return: StacItem. The StacItem is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItem + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacItem] = kwargs.pop("cls", None) + + _request = build_stac_get_item_request( + collection_id=collection_id, + item_id=item_id, + sign=sign, + duration_in_minutes=duration_in_minutes, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_collection( + self, + collection_id: str, + *, + limit: Optional[int] = None, + bounding_box: Optional[List[str]] = None, + datetime: Optional[str] = None, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + token: Optional[str] = None, + **kwargs: Any + ) -> _models.StacItemCollection: + """Fetch features of the feature collection with id ``collectionId``. + + Every feature in a dataset belongs to a collection. A dataset may + consist of multiple feature collections. A feature collection is often a + collection of features of a similar type, based on a common schema. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :keyword limit: The optional limit parameter recommends the number of items that should be + present in the response document. + + If the limit parameter value is greater than advertised limit maximum, the server must return + the + maximum possible number of items, rather than responding with an error. + + Only items are counted that are on the first level of the collection in the response document. + Nested objects contained within the explicitly requested items must not be counted. + + Minimum = 1. Maximum = 10000. Default = 10. Default value is None. + :paramtype limit: int + :keyword bounding_box: Only features that have a geometry that intersects the bounding box are + selected. + The bounding box is provided as four or six numbers, depending on whether the + coordinate reference system includes a vertical axis (height or depth): + + + + * Lower left corner, coordinate axis 1 + * Lower left corner, coordinate axis 2 + * Minimum value, coordinate axis 3 (optional) + * Upper right corner, coordinate axis 1 + * Upper right corner, coordinate axis 2 + * Maximum value, coordinate axis 3 (optional) + + The coordinate reference system of the values is WGS 84 longitude/latitude + (`http://www.opengis.net/def/crs/OGC/1.3/CRS84 + `_). + + For WGS 84 longitude/latitude the values are in most cases the sequence of + minimum longitude, minimum latitude, maximum longitude and maximum latitude. + However, in cases where the box spans the antimeridian the first value + (west-most box edge) is larger than the third value (east-most box edge). + + If the vertical axis is included, the third and the sixth number are + the bottom and the top of the 3-dimensional bounding box. + + If a feature has multiple spatial geometry properties, it is the decision of the + server whether only a single spatial geometry property is used to determine + the extent or all relevant geometries. Default value is None. + :paramtype bounding_box: list[str] + :keyword datetime: Either a date-time or an interval, open or closed. Date and time expressions + adhere to RFC 3339. Open intervals are expressed using double-dots. + + Examples: + + + + * A date-time: "2018-02-12T23:20:50Z" + * A closed interval: "2018-02-12T00:00:00Z/2018-03-18T12:31:12Z" + * Open intervals: "2018-02-12T00:00:00Z/.." or "../2018-03-18T12:31:12Z" + + Only features that have a temporal property that intersects the value of + ``datetime`` are selected. + + If a feature has multiple temporal properties, it is the decision of the + server whether only a single temporal property is used to determine + the extent or all relevant temporal properties. Default value is None. + :paramtype datetime: str + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :keyword token: Pagination token for fetching the next set of results. Default value is None. + :paramtype token: str + :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacItemCollection] = kwargs.pop("cls", None) + + _request = build_stac_get_item_collection_request( + collection_id=collection_id, + limit=limit, + bounding_box=bounding_box, + datetime=datetime, + sign=sign, + duration_in_minutes=duration_in_minutes, + token=token, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItemCollection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_item_initial( + self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/merge-patch+json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_update_item_request( + collection_id=collection_id, + item_id=item_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["operation-location"] = self._deserialize("str", response.headers.get("operation-location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_item( + self, + collection_id: str, + item_id: str, + body: _models.StacItem, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> LROPoller[None]: + """Update a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Required. + :type body: ~azure.planetarycomputer.models.StacItem + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_item( + self, + collection_id: str, + item_id: str, + body: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> LROPoller[None]: + """Update a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_item( + self, + collection_id: str, + item_id: str, + body: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> LROPoller[None]: + """Update a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/merge-patch+json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_item( + self, collection_id: str, item_id: str, body: Union[_models.StacItem, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Update a STAC item in a collection. + + :param collection_id: Catalog collection id. Required. + :type collection_id: str + :param item_id: STAC Item id. Required. + :type item_id: str + :param body: STAC Item. Is one of the following types: StacItem, JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacItem or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_item_initial( + collection_id=collection_id, + item_id=item_id, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def create_queryables( + self, + collection_id: str, + body: List[_models.StacQueryable], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.StacQueryable]: + """Set Collection Queryables. + + Set queryables for a collection given a list of queryable definitions. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Request queryable definition body. Required. + :type body: list[~azure.planetarycomputer.models.StacQueryable] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of StacQueryable + :rtype: list[~azure.planetarycomputer.models.StacQueryable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_queryables( + self, collection_id: str, body: List[JSON], *, content_type: str = "application/json", **kwargs: Any + ) -> List[_models.StacQueryable]: + """Set Collection Queryables. + + Set queryables for a collection given a list of queryable definitions. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Request queryable definition body. Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of StacQueryable + :rtype: list[~azure.planetarycomputer.models.StacQueryable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_queryables( + self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[_models.StacQueryable]: + """Set Collection Queryables. + + Set queryables for a collection given a list of queryable definitions. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Request queryable definition body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of StacQueryable + :rtype: list[~azure.planetarycomputer.models.StacQueryable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_queryables( + self, collection_id: str, body: Union[List[_models.StacQueryable], List[JSON], IO[bytes]], **kwargs: Any + ) -> List[_models.StacQueryable]: + """Set Collection Queryables. + + Set queryables for a collection given a list of queryable definitions. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param body: Request queryable definition body. Is one of the following types: [StacQueryable], + [JSON], IO[bytes] Required. + :type body: list[~azure.planetarycomputer.models.StacQueryable] or list[JSON] or IO[bytes] + :return: list of StacQueryable + :rtype: list[~azure.planetarycomputer.models.StacQueryable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.StacQueryable]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_create_queryables_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.StacQueryable], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def replace_queryable( + self, + collection_id: str, + queryable_name: str, + body: _models.StacQueryable, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacQueryable: + """Update Collection Queryables. + + Updates a queryable given a queryable definition and corresponding collection id. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param queryable_name: Name of the queryable property to operate on. Required. + :type queryable_name: str + :param body: Request queryable definition body. Required. + :type body: ~azure.planetarycomputer.models.StacQueryable + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacQueryable. The StacQueryable is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacQueryable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_queryable( + self, + collection_id: str, + queryable_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacQueryable: + """Update Collection Queryables. + + Updates a queryable given a queryable definition and corresponding collection id. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param queryable_name: Name of the queryable property to operate on. Required. + :type queryable_name: str + :param body: Request queryable definition body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacQueryable. The StacQueryable is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacQueryable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace_queryable( + self, + collection_id: str, + queryable_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacQueryable: + """Update Collection Queryables. + + Updates a queryable given a queryable definition and corresponding collection id. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param queryable_name: Name of the queryable property to operate on. Required. + :type queryable_name: str + :param body: Request queryable definition body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StacQueryable. The StacQueryable is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacQueryable + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace_queryable( + self, + collection_id: str, + queryable_name: str, + body: Union[_models.StacQueryable, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.StacQueryable: + """Update Collection Queryables. + + Updates a queryable given a queryable definition and corresponding collection id. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param queryable_name: Name of the queryable property to operate on. Required. + :type queryable_name: str + :param body: Request queryable definition body. Is one of the following types: StacQueryable, + JSON, IO[bytes] Required. + :type body: ~azure.planetarycomputer.models.StacQueryable or JSON or IO[bytes] + :return: StacQueryable. The StacQueryable is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacQueryable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StacQueryable] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_replace_queryable_request( + collection_id=collection_id, + queryable_name=queryable_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacQueryable, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_queryable( # pylint: disable=inconsistent-return-statements + self, collection_id: str, queryable_name: str, **kwargs: Any + ) -> None: + """Delete Queryables. + + Delete queryables by name for specified collection. + + :param collection_id: Unique identifier for the STAC collection. Required. + :type collection_id: str + :param queryable_name: Name of the queryable property to operate on. Required. + :type queryable_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stac_delete_queryable_request( + collection_id=collection_id, + queryable_name=queryable_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_queryables(self, **kwargs: Any) -> _models.QueryableDefinitionsResponse: + """Queryables. + + List all queryables in the GeoCatalog instance. + + :return: QueryableDefinitionsResponse. The QueryableDefinitionsResponse is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.QueryableDefinitionsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.QueryableDefinitionsResponse] = kwargs.pop("cls", None) + + _request = build_stac_list_queryables_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QueryableDefinitionsResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_queryables(self, collection_id: str, **kwargs: Any) -> _models.QueryableDefinitionsResponse: + """Collection Queryables. + + List all queryables in a given collection. + + :param collection_id: Collection ID. Required. + :type collection_id: str + :return: QueryableDefinitionsResponse. The QueryableDefinitionsResponse is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.QueryableDefinitionsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.QueryableDefinitionsResponse] = kwargs.pop("cls", None) + + _request = build_stac_get_collection_queryables_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.QueryableDefinitionsResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def search( + self, + body: _models.StacSearchParameters, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemCollection: + """Search. + + STAC search operation. + + :param body: Request body. Required. + :type body: ~azure.planetarycomputer.models.StacSearchParameters + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def search( + self, + body: JSON, + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemCollection: + """Search. + + STAC search operation. + + :param body: Request body. Required. + :type body: JSON + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def search( + self, + body: IO[bytes], + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemCollection: + """Search. + + STAC search operation. + + :param body: Request body. Required. + :type body: IO[bytes] + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def search( + self, + body: Union[_models.StacSearchParameters, JSON, IO[bytes]], + *, + sign: Optional[Union[str, _models.StacAssetUrlSigningMode]] = None, + duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> _models.StacItemCollection: + """Search. + + STAC search operation. + + :param body: Request body. Is one of the following types: StacSearchParameters, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.StacSearchParameters or JSON or IO[bytes] + :keyword sign: Whether to sign asset URLs in the response. Known values are: "true" and + "false". Default value is None. + :paramtype sign: str or ~azure.planetarycomputer.models.StacAssetUrlSigningMode + :keyword duration_in_minutes: URL signature duration in minutes. Default value is None. + :paramtype duration_in_minutes: int + :return: StacItemCollection. The StacItemCollection is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemCollection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StacItemCollection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_stac_search_request( + sign=sign, + duration_in_minutes=duration_in_minutes, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItemCollection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DataOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s + :attr:`data` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PlanetaryComputerProClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_tile_matrix_definitions(self, tile_matrix_set_id: str, **kwargs: Any) -> _models.TileMatrixSet: + """Matrix Definition. + + Return Matrix Definition. + + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :return: TileMatrixSet. The TileMatrixSet is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileMatrixSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileMatrixSet] = kwargs.pop("cls", None) + + _request = build_data_get_tile_matrix_definitions_request( + tile_matrix_set_id=tile_matrix_set_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileMatrixSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_tile_matrices(self, **kwargs: Any) -> List[str]: + """Matrix List. + + Return Matrix List. + + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_data_list_tile_matrices_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[str], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_class_map_legend( + self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any + ) -> _models.ClassMapLegendResponse: + """Get ClassMap Legend. + + Generate values and color swatches mapping for a given classmap. + + :param classmap_name: classmap name. Required. + :type classmap_name: str + :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. + :paramtype trim_start: int + :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. + :paramtype trim_end: int + :return: ClassMapLegendResponse. The ClassMapLegendResponse is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.ClassMapLegendResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ClassMapLegendResponse] = kwargs.pop("cls", None) + + _request = build_data_get_class_map_legend_request( + classmap_name=classmap_name, + trim_start=trim_start, + trim_end=trim_end, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ClassMapLegendResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_interval_legend( + self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any + ) -> List[List[List[int]]]: + """Get Interval Legend. + + Generate values and color swatches mapping for a given interval classmap. + + Returns a color map for intervals, where each interval is defined by: + + * A numeric range `[min, max]` representing the interval boundaries. + * An RGBA color `[red, green, blue, alpha]` associated with the interval. + + The response is a 2D array of interval definitions, where each element is a pair: + + * The first element is an array of two numbers `[min, max]` defining the interval. + * The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA + color. + + Example: + + .. code-block:: json + + [ + [ + [-2, 0], [0, 0, 0, 0] + ], + [ + [1, 32], [255, 255, 178, 255] + ] + ]This example defines two intervals: + + * The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black). + * The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow). + + :param classmap_name: classmap name. Required. + :type classmap_name: str + :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. + :paramtype trim_start: int + :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. + :paramtype trim_end: int + :return: list of list of list of int + :rtype: list[list[list[int]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[List[List[int]]]] = kwargs.pop("cls", None) + + _request = build_data_get_interval_legend_request( + classmap_name=classmap_name, + trim_start=trim_start, + trim_end=trim_end, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[List[List[int]]], response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_legend( + self, + color_map_name: str, + *, + height: Optional[float] = None, + width: Optional[float] = None, + trim_start: Optional[int] = None, + trim_end: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Get Legend. + + Generate a legend image for a given colormap. + + If the colormap has non-contiguous values at the beginning or end, + which aren't desired in the output image, they can be trimmed by specifying + the number of values to trim. + + :param color_map_name: The name of the registered colormap to generate a legend for. Required. + :type color_map_name: str + :keyword height: The output height of the legend image. Default value is None. + :paramtype height: float + :keyword width: The output width of the legend image. Default value is None. + :paramtype width: float + :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. + :paramtype trim_start: int + :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. + :paramtype trim_end: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_legend_request( + color_map_name=color_map_name, + height=height, + width=width, + trim_start=trim_start, + trim_end=trim_end, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def register_mosaics_search( + self, + *, + content_type: str = "application/json", + collections: Optional[List[str]] = None, + ids: Optional[List[str]] = None, + bounding_box: Optional[List[float]] = None, + intersects: Optional[_models.Geometry] = None, + query: Optional[dict[str, Any]] = None, + filter: Optional[dict[str, Any]] = None, + datetime: Optional[str] = None, + sort_by: Optional[List[_models.StacSortExtension]] = None, + filter_language: Optional[Union[str, _models.FilterLanguage]] = None, + metadata: Optional[_models.MosaicMetadata] = None, + **kwargs: Any + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. + + Register a Search query. + + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is + None. + :paramtype collections: list[str] + :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. + :paramtype ids: list[str] + :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. + Default value is None. + :paramtype bounding_box: list[float] + :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value + is None. + :paramtype intersects: ~azure.planetarycomputer.models.Geometry + :keyword query: Query. Default value is None. + :paramtype query: dict[str, any] + :keyword filter: Filter. Default value is None. + :paramtype filter: dict[str, any] + :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. + :paramtype datetime: str + :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. + :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] + :keyword filter_language: Query language format used in the filter parameter. Known values are: + "cql-json", "cql2-json", and "cql2-text". Default value is None. + :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage + :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. + :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def register_mosaics_search( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. + + Register a Search query. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def register_mosaics_search( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. + + Register a Search query. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def register_mosaics_search( # pylint: disable=too-many-locals + self, + body: Union[JSON, IO[bytes]] = _Unset, + *, + collections: Optional[List[str]] = None, + ids: Optional[List[str]] = None, + bounding_box: Optional[List[float]] = None, + intersects: Optional[_models.Geometry] = None, + query: Optional[dict[str, Any]] = None, + filter: Optional[dict[str, Any]] = None, + datetime: Optional[str] = None, + sort_by: Optional[List[_models.StacSortExtension]] = None, + filter_language: Optional[Union[str, _models.FilterLanguage]] = None, + metadata: Optional[_models.MosaicMetadata] = None, + **kwargs: Any + ) -> _models.TilerMosaicSearchRegistrationResponse: + """Register Search. + + Register a Search query. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is + None. + :paramtype collections: list[str] + :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. + :paramtype ids: list[str] + :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. + Default value is None. + :paramtype bounding_box: list[float] + :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value + is None. + :paramtype intersects: ~azure.planetarycomputer.models.Geometry + :keyword query: Query. Default value is None. + :paramtype query: dict[str, any] + :keyword filter: Filter. Default value is None. + :paramtype filter: dict[str, any] + :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. + :paramtype datetime: str + :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. + :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] + :keyword filter_language: Query language format used in the filter parameter. Known values are: + "cql-json", "cql2-json", and "cql2-text". Default value is None. + :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage + :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. + :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata + :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is + compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TilerMosaicSearchRegistrationResponse] = kwargs.pop("cls", None) + + if body is _Unset: + body = { + "bbox": bounding_box, + "collections": collections, + "datetime_property": datetime, + "filter": filter, + "filter_lang": filter_language, + "ids": ids, + "intersects": intersects, + "metadata": metadata, + "query": query, + "sortby": sort_by, + } + body = {k: v for k, v in body.items() if v is not None} + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_register_mosaics_search_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerMosaicSearchRegistrationResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_tilesets( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetList: + """Tileset List. + + Return a list of available tilesets for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetList. The TileSetList is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetList] = kwargs.pop("cls", None) + + _request = build_data_list_tilesets_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tileset_metadata( + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetMetadata: + """Tileset Metadata. + + Return metadata for a specific tileset of a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetMetadata. The TileSetMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_tileset_metadata_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Tilematrixsetid Plain. + + Create map tile from a dataset (without scale or format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_by_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Tilematrixsetid Format. + + Create map tile from a dataset (with format in path, without scale). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_by_format_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_by_scale( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Tilematrixsetid Scale. + + Create map tile from a dataset (with scale in path, without format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_by_scale_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_by_scale_and_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Tilematrixsetid. + + Create map tile from a dataset (with TileMatrixSetId, scale, and format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_by_scale_and_format_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_no_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Plain. + + Create map tile from a dataset (without TileMatrixSetId, scale or format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_no_tms_request( + collection_id=collection_id, + item_id=item_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_no_tms_by_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Format. + + Create map tile from a dataset (with format in path, without TileMatrixSetId or scale). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_no_tms_by_format_request( + collection_id=collection_id, + item_id=item_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + scale=scale, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_no_tms_by_scale( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile Scale. + + Create map tile from a dataset (with scale in path, without TileMatrixSetId or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_no_tms_by_scale_request( + collection_id=collection_id, + item_id=item_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_tile_no_tms_by_scale_and_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Tile. + + Create map tile from a dataset (with scale and format in path, without TileMatrixSetId). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_tile_no_tms_by_scale_and_format_request( + collection_id=collection_id, + item_id=item_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def crop_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def crop_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_feature_geo_json_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + format=format, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def crop_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_feature_geo_json_format_request( + collection_id=collection_id, + item_id=item_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def crop_feature_geo_json_width_by_height( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + width: int, + height: int, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_feature_geo_json_width_by_height_request( + collection_id=collection_id, + item_id=item_id, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_bounds( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.StacItemBounds: + """Item Bounds. + + Return the bounds for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: StacItemBounds. The StacItemBounds is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemBounds + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StacItemBounds] = kwargs.pop("cls", None) + + _request = build_data_get_item_bounds_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItemBounds, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_info( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + assets: Optional[List[str]] = None, + **kwargs: Any + ) -> _models.TilerInfoMapResponse: + """Item Info. + + Return dataset's basic info for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :return: TilerInfoMapResponse. The TilerInfoMapResponse is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerInfoMapResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerInfoMapResponse] = kwargs.pop("cls", None) + + _request = build_data_get_item_info_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + assets=assets, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerInfoMapResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_info_geo_json( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + assets: Optional[List[str]] = None, + **kwargs: Any + ) -> _models.TilerInfoGeoJsonFeature: + """Item Info Geojson. + + Return info as GeoJSON for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :return: TilerInfoGeoJsonFeature. The TilerInfoGeoJsonFeature is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerInfoGeoJsonFeature + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerInfoGeoJsonFeature] = kwargs.pop("cls", None) + + _request = build_data_get_item_info_geo_json_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + assets=assets, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerInfoGeoJsonFeature, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_item_available_assets( + self, + collection_id: str, + item_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> List[str]: + """Item Available Assets. + + Return a list of supported assets for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + _request = build_data_list_item_available_assets_request( + collection_id=collection_id, + item_id=item_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[str], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_asset_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + asset_band_indices: Optional[List[str]] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + asset_expression: Optional[List[str]] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any + ) -> _models.AssetStatisticsResponse: + """Item Asset Statistics. + + Per asset statistics for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword asset_expression: Per asset band expression. Default value is None. + :paramtype asset_expression: list[str] + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :return: AssetStatisticsResponse. The AssetStatisticsResponse is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.AssetStatisticsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AssetStatisticsResponse] = kwargs.pop("cls", None) + + _request = build_data_get_item_asset_statistics_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + asset_band_indices=asset_band_indices, + no_data=no_data, + unscale=unscale, + reproject=reproject, + resampling=resampling, + max_size=max_size, + categorical=categorical, + categories_pixels=categories_pixels, + percentiles=percentiles, + histogram_bins=histogram_bins, + histogram_range=histogram_range, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + asset_expression=asset_expression, + height=height, + width=width, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AssetStatisticsResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_item_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any + ) -> _models.TilerStacItemStatistics: + """Item Statistics. + + Merged assets statistics for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :return: TilerStacItemStatistics. The TilerStacItemStatistics is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerStacItemStatistics + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerStacItemStatistics] = kwargs.pop("cls", None) + + _request = build_data_list_item_statistics_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + resampling=resampling, + max_size=max_size, + categorical=categorical, + categories_pixels=categories_pixels, + percentiles=percentiles, + histogram_bins=histogram_bins, + histogram_range=histogram_range, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + algorithm=algorithm, + algorithm_params=algorithm_params, + height=height, + width=width, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerStacItemStatistics, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_item_geo_json_statistics( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + categorical: Optional[bool] = None, + categories_pixels: Optional[List[int]] = None, + percentiles: Optional[List[int]] = None, + histogram_bins: Optional[str] = None, + histogram_range: Optional[str] = None, + destination_crs: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + algorithm: Optional[str] = None, + algorithm_params: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + **kwargs: Any + ) -> _models.StacItemStatisticsGeoJson: + """Item Geojson Statistics. + + Get statistics from a GeoJSON feature for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Maximum dimension in pixels for the source data used to calculate + statistics. Default value is None. + :paramtype max_size: int + :keyword categorical: Return statistics for categorical dataset. Default value is None. + :paramtype categorical: bool + :keyword categories_pixels: List of pixel categorical values for which to report counts. + Default value is None. + :paramtype categories_pixels: list[int] + :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. + :paramtype percentiles: list[int] + :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by + default). + + If bins is a sequence (comma ``,`` delimited values), it defines a monotonically + increasing array of bin edges, including the rightmost edge, allowing for + non-uniform bin widths. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_bins: str + :keyword histogram_range: Comma ``,`` delimited range of the bins. + + The lower and upper range of the bins. If not provided, range is simply + (a.min(), a.max()). + + Values outside the range are ignored. The first element of the range must be + less than or equal to the second. + range affects the automatic bin computation as well. + + link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html + `_. Default value is + None. + :paramtype histogram_range: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword algorithm: Algorithm name. Default value is None. + :paramtype algorithm: str + :keyword algorithm_params: Algorithm parameter. Default value is None. + :paramtype algorithm_params: str + :keyword height: Force output image height. Default value is None. + :paramtype height: int + :keyword width: Force output image width. Default value is None. + :paramtype width: int + :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StacItemStatisticsGeoJson] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_get_item_geo_json_statistics_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + max_size=max_size, + categorical=categorical, + categories_pixels=categories_pixels, + percentiles=percentiles, + histogram_bins=histogram_bins, + histogram_range=histogram_range, + destination_crs=destination_crs, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + algorithm=algorithm, + algorithm_params=algorithm_params, + height=height, + width=width, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StacItemStatisticsGeoJson, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_tile_json( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Item TileJson. + + Return TileJSON document for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_item_tile_json_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_tile_json_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Item TileJson Tilematrixsetid As Path. + + Return TileJSON document for a STAC item with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_item_tile_json_tms_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_wmts_capabilities( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Item Wmts. + + OGC WMTS endpoint for a STAC item. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_wmts_capabilities_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_wmts_capabilities_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Item Wmts Tilematrixsetid As Path. + + OGC WMTS endpoint for a STAC item with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_wmts_capabilities_tms_request( + collection_id=collection_id, + item_id=item_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + resampling=resampling, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_point( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + longitude: float, + latitude: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any + ) -> _models.TilerCoreModelsResponsesPoint: + """Item Point. + + Get point value for a STAC item dataset. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) + + _request = build_data_get_item_point_request( + collection_id=collection_id, + item_id=item_id, + longitude=longitude, + latitude=latitude, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, + resampling=resampling, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_preview( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + color_formula: Optional[str] = None, + dst_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Item Preview. + + Create preview of a STAC item dataset. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword dst_crs: Output Coordinate Reference System. Default value is None. + :paramtype dst_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_preview_request( + collection_id=collection_id, + item_id=item_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + color_formula=color_formula, + dst_crs=dst_crs, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_preview_with_format( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + dst_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Item Preview With Format. + + Create preview of a STAC item dataset with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword dst_crs: Output Coordinate Reference System. Default value is None. + :paramtype dst_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_preview_with_format_request( + collection_id=collection_id, + item_id=item_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + dst_crs=dst_crs, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_bbox_crop( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Item Bbox. + + Create an image from part of a STAC item dataset (bounding box crop). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_bbox_crop_request( + collection_id=collection_id, + item_id=item_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + resampling=resampling, + max_size=max_size, + height=height, + width=width, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_item_bbox_crop_with_dimensions( # pylint: disable=too-many-locals + self, + collection_id: str, + item_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + color_formula: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + max_size: Optional[int] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Item Bbox With Dimensions. + + Create an image from part of a STAC item dataset (bounding box crop with dimensions). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param item_id: STAC Item Identifier. Required. + :type item_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param width: Force output image width. Required. + :type width: int + :param height: Force output image height. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_item_bbox_crop_with_dimensions_request( + collection_id=collection_id, + item_id=item_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + algorithm=algorithm, + algorithm_params=algorithm_params, + color_formula=color_formula, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + resampling=resampling, + max_size=max_size, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_collection_tilesets( # pylint: disable=too-many-locals + self, + collection_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetList: + """Collection Tileset List. + + Return a list of available tilesets for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetList. The TileSetList is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetList] = kwargs.pop("cls", None) + + _request = build_data_list_collection_tilesets_request( + collection_id=collection_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tileset_metadata( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetMetadata: + """Collection Tileset Metadata. + + Return metadata for a specific tileset of a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetMetadata. The TileSetMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tileset_metadata_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_by_scale_and_format( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Tilematrixsetid. + + Create map tile for a STAC collection (with TileMatrixSetId, scale, and format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_by_scale_and_format_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Tilematrixsetid Plain. + + Create map tile for a STAC collection (with TileMatrixSetId, without scale or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_by_format( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Tilematrixsetid Format. + + Create map tile for a STAC collection (with TileMatrixSetId and format, without scale). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_by_format_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_by_scale( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Tilematrixsetid Scale. + + Create map tile for a STAC collection (with TileMatrixSetId and scale, without format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_by_scale_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_no_tms_by_scale_and_format( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile. + + Create map tile for a STAC collection (without TileMatrixSetId, with scale and format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles (default: + "1"). Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp) (default: "png"). + Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_by_scale_and_format_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_no_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Plain. + + Create map tile for a STAC collection (without TileMatrixSetId, scale, or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_no_tms_by_format( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Format. + + Create map tile for a STAC collection (with format, without TileMatrixSetId or scale). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_by_format_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_no_tms_by_scale( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + scale: float, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Tile Scale. + + Create map tile for a STAC collection (with scale, without TileMatrixSetId or format). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_no_tms_by_scale_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_json( # pylint: disable=too-many-locals + self, + collection_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Collection TileJson. + + Return TileJSON document for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_json_request( + collection_id=collection_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_tile_json_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, + **kwargs: Any + ) -> _models.TileJsonMetadata: + """Collection TileJson Tilematrixsetid As Path. + + Return TileJSON document for a STAC collection with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_collection_tile_json_tms_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_wmts_capabilities( + self, + collection_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Wmts. + + OGC WMTS endpoint for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_wmts_capabilities_request( + collection_id=collection_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_wmts_capabilities_tms( + self, + collection_id: str, + tile_matrix_set_id: str, + *, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Wmts Tilematrixsetid As Path. + + OGC WMTS endpoint for a STAC collection with TileMatrixSetId as path. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_wmts_capabilities_tms_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_assets_for_tile( # pylint: disable=too-many-locals + self, + collection_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> List[_models.TilerAssetGeoJson]: + """Collection Assets For Tile Tilematrixsetid As Path. + + Return a list of assets which overlap a given tile for a STAC collection (with + TileMatrixSetId). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: list of TilerAssetGeoJson + :rtype: list[~azure.planetarycomputer.models.TilerAssetGeoJson] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TilerAssetGeoJson]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_assets_for_tile_request( + collection_id=collection_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.TilerAssetGeoJson], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_assets_for_tile_no_tms( # pylint: disable=too-many-locals + self, + collection_id: str, + z: float, + x: float, + y: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + **kwargs: Any + ) -> List[Any]: + """Collection Assets For Tile. + + Return a list of assets which overlap a given tile for a STAC collection (without + TileMatrixSetId). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_assets_for_tile_no_tms_request( + collection_id=collection_id, + z=z, + x=x, + y=y, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + tile_matrix_set_id=tile_matrix_set_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_assets_for_bbox( # pylint: disable=too-many-locals + self, + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any + ) -> List[Any]: + """Collection Assets For Bbox. + + Return a list of assets which overlap a given bounding box for a STAC collection. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_assets_for_bbox_request( + collection_id=collection_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_info(self, collection_id: str, **kwargs: Any) -> _models.TilerStacSearchRegistration: + """Collection Info. + + Return search query info from a STAC collection identifier. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :return: TilerStacSearchRegistration. The TilerStacSearchRegistration is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerStacSearchRegistration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TilerStacSearchRegistration] = kwargs.pop("cls", None) + + _request = build_data_get_collection_info_request( + collection_id=collection_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerStacSearchRegistration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_bbox_crop( # pylint: disable=too-many-locals + self, + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Bbox. + + Create an image from part of a STAC collection dataset (bounding box crop). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_bbox_crop_request( + collection_id=collection_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_collection_bbox_crop_with_dimensions( # pylint: disable=too-many-locals + self, + collection_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Bbox With Dimensions. + + Create an image from part of a STAC collection dataset (bounding box crop with dimensions). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param width: Force output image width. Required. + :type width: int + :param height: Force output image height. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_collection_bbox_crop_with_dimensions_request( + collection_id=collection_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def crop_collection_feature_geo_json( # pylint: disable=too-many-locals + self, + collection_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_collection_feature_geo_json_request( + collection_id=collection_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + format=format, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def crop_collection_feature_geo_json_format( # pylint: disable=too-many-locals + self, + collection_id: str, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_collection_feature_geo_json_format_request( + collection_id=collection_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def crop_collection_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + collection_id: str, + width: int, + height: int, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Collection Geojson Feature Crop With Dimensions. + + Create image from a geojson feature with dimensions. + + :param collection_id: STAC Collection Identifier. Required. + :type collection_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9177,13 +32134,63 @@ def list_tile_matrices(self, **kwargs: Any) -> List[str]: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[str]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_list_tile_matrices_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_collection_feature_geo_json_width_by_height_request( + collection_id=collection_id, + width=width, + height=height, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -9192,7 +32199,8 @@ def list_tile_matrices(self, **kwargs: Any) -> List[str]: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -9208,97 +32216,139 @@ def list_tile_matrices(self, **kwargs: Any) -> List[str]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[str], response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_asset_statistics( # pylint: disable=too-many-locals + def get_collection_point( # pylint: disable=too-many-locals self, collection_id: str, - item_id: str, + longitude: float, + latitude: float, *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, **kwargs: Any - ) -> _models.AssetStatisticsResponse: - """Asset Statistics. + ) -> _models.TilerCoreModelsResponsesPoint: + """Collection Point. - Per Asset statistics. + Get Point value for a collection dataset. :param collection_id: STAC Collection Identifier. Required. :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :return: AssetStatisticsResponse. The AssetStatisticsResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.AssetStatisticsResponse + :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9312,24 +32362,38 @@ def get_asset_statistics( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AssetStatisticsResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) - _request = build_data_get_asset_statistics_request( + _request = build_data_get_collection_point_request( collection_id=collection_id, - item_id=item_id, + longitude=longitude, + latitude=latitude, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + coordinate_reference_system=coordinate_reference_system, resampling=resampling, - max_size=max_size, - categorical=categorical, - categories_pixels=categories_pixels, - percentiles=percentiles, - histogram_bins=histogram_bins, - histogram_range=histogram_range, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9339,6 +32403,7 @@ def get_asset_statistics( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9356,9 +32421,9 @@ def get_asset_statistics( # pylint: disable=too-many-locals raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AssetStatisticsResponse, response.json()) + deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9366,17 +32431,89 @@ def get_asset_statistics( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace - def list_available_assets(self, collection_id: str, item_id: str, **kwargs: Any) -> List[str]: - """Available Assets. + def get_collection_point_assets( # pylint: disable=too-many-locals + self, + collection_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + ids: Optional[str] = None, + bbox: Optional[str] = None, + query: Optional[str] = None, + sortby: Optional[str] = None, + datetime: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any + ) -> List[_models.StacItemPointAsset]: + """Collection Point Assets. - Return a list of supported assets. + Return a list of assets for a given point in a collection. :param collection_id: STAC Collection Identifier. Required. :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :return: list of str - :rtype: list[str] + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword ids: Array of Item ids. Default value is None. + :paramtype ids: str + :keyword bbox: Bounding box (west, south, east, north). Default value is None. + :paramtype bbox: str + :keyword query: JSON query expression for filtering items. Default value is None. + :paramtype query: str + :keyword sortby: Sorting expression (e.g. +/-property). Default value is None. + :paramtype sortby: str + :keyword datetime: Datetime filter expression (single datetime or range using ``/`` separator). + Default value is None. + :paramtype datetime: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of StacItemPointAsset + :rtype: list[~azure.planetarycomputer.models.StacItemPointAsset] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9390,11 +32527,29 @@ def list_available_assets(self, collection_id: str, item_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[str]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.StacItemPointAsset]] = kwargs.pop("cls", None) - _request = build_data_list_available_assets_request( + _request = build_data_get_collection_point_assets_request( collection_id=collection_id, - item_id=item_id, + longitude=longitude, + latitude=latitude, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + ids=ids, + bbox=bbox, + query=query, + sortby=sortby, + datetime=datetime, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9404,6 +32559,7 @@ def list_available_assets(self, collection_id: str, item_id: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9421,9 +32577,9 @@ def list_available_assets(self, collection_id: str, item_id: str, **kwargs: Any) raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(List[str], response.json()) + deserialized = _deserialize(List[_models.StacItemPointAsset], response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9431,17 +32587,45 @@ def list_available_assets(self, collection_id: str, item_id: str, **kwargs: Any) return deserialized # type: ignore @distributed_trace - def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _models.StacItemBounds: - """Bounds. + def list_searches_tilesets( + self, + search_id: str, + *, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + **kwargs: Any + ) -> _models.TileSetList: + """Searches Tileset List. - Return all Bounds. + Return a list of available tilesets for a mosaic search. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :return: StacItemBounds. The StacItemBounds is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemBounds + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetList. The TileSetList is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetList :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9455,11 +32639,17 @@ def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.StacItemBounds] = kwargs.pop("cls", None) + cls: ClsType[_models.TileSetList] = kwargs.pop("cls", None) - _request = build_data_get_bounds_request( - collection_id=collection_id, - item_id=item_id, + _request = build_data_list_searches_tilesets_request( + search_id=search_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9469,6 +32659,7 @@ def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _models } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -9486,334 +32677,259 @@ def get_bounds(self, collection_id: str, item_id: str, **kwargs: Any) -> _models raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.StacItemBounds, response.json()) + deserialized = _deserialize(_models.TileSetList, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def crop_geo_json( - self, - collection_id: str, - item_id: str, - format: str, - body: _models.Feature, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterator[bytes]: - """Geojson Crop. - - Create image from a geojson feature. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: ~azure.planetarycomputer.models.Feature - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def crop_geo_json( + @distributed_trace + def get_searches_tileset_metadata( self, - collection_id: str, - item_id: str, - format: str, - body: JSON, + search_id: str, + tile_matrix_set_id: str, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, - content_type: str = "application/json", + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, **kwargs: Any - ) -> Iterator[bytes]: - """Geojson Crop. + ) -> _models.TileSetMetadata: + """Searches Tileset Metadata. - Create image from a geojson feature. + Return metadata for a specific tileset of a mosaic search. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: JSON - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :return: TileSetMetadata. The TileSetMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileSetMetadata :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def crop_geo_json( + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TileSetMetadata] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tileset_metadata_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileSetMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_searches_tile_by_scale_and_format( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, format: str, - body: IO[bytes], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - content_type: str = "application/json", + padding: Optional[int] = None, **kwargs: Any ) -> Iterator[bytes]: - """Geojson Crop. + """Searches Tile Tilematrixsetid. - Create image from a geojson feature. + Create map tile (with TileMatrixSetId, scale, and format in path). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str - :param body: Request GeoJson body. Required. - :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -9846,96 +32962,260 @@ def crop_geo_json( "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_by_scale_and_format_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - def crop_geo_json( # pylint: disable=too-many-locals + def get_searches_tile( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - format: str, - body: Union[_models.Feature, JSON, IO[bytes]], + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - height: Optional[int] = None, - width: Optional[int] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any ) -> Iterator[bytes]: - """Geojson Crop. + """Searches Tile Tilematrixsetid Plain. - Create image from a geojson feature. + Create map tile (with TileMatrixSetId, without scale or format). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int - :keyword height: Height in pixels for the output image. Default value is None. - :paramtype height: int - :keyword width: Width in pixels for the output image. Default value is None. - :paramtype width: int + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -9968,13 +33248,20 @@ def crop_geo_json( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -9987,44 +33274,51 @@ def crop_geo_json( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_crop_geo_json_request( - collection_id=collection_id, - item_id=item_id, - format=format, + _request = build_data_get_searches_tile_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, + format=format, + scale=scale, + buffer=buffer, color_formula=color_formula, - coordinate_reference_system=coordinate_reference_system, + collection=collection, resampling=resampling, - max_size=max_size, - height=height, - width=width, + pixel_selection=pixel_selection, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, - content_type=content_type, + padding=padding, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10033,6 +33327,7 @@ def crop_geo_json( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -10058,88 +33353,154 @@ def crop_geo_json( # pylint: disable=too-many-locals response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def crop_geo_json_with_dimensions( + @distributed_trace + def get_searches_tile_by_format( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - width: int, - height: int, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, format: str, - body: _models.Feature, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - content_type: str = "application/json", + padding: Optional[int] = None, **kwargs: Any ) -> Iterator[bytes]: - """Geojson Crop. + """Searches Tile Tilematrixsetid Format. - Create image from a geojson feature. + Create map tile (with TileMatrixSetId and format, without scale). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str - :param body: Request GeoJson body. Required. - :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -10172,96 +33533,259 @@ def crop_geo_json_with_dimensions( "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_by_format_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore - @overload - def crop_geo_json_with_dimensions( + @distributed_trace + def get_searches_tile_by_scale( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - width: int, - height: int, - format: str, - body: JSON, + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - content_type: str = "application/json", + padding: Optional[int] = None, **kwargs: Any ) -> Iterator[bytes]: - """Geojson Crop. + """Searches Tile Tilematrixsetid Scale. - Create image from a geojson feature. + Create map tile (with TileMatrixSetId and scale, without format). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: JSON + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -10294,218 +33818,401 @@ def crop_geo_json_with_dimensions( "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def crop_geo_json_with_dimensions( + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_tile_by_scale_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_searches_assets_for_tile( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - width: int, - height: int, - format: str, - body: IO[bytes], + search_id: str, + tile_matrix_set_id: str, + z: float, + x: float, + y: float, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, - content_type: str = "application/json", + collection_id: str, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, **kwargs: Any - ) -> Iterator[bytes]: - """Geojson Crop. - - Create image from a geojson feature. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Required. - :type body: IO[bytes] - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default + ) -> List[_models.TilerAssetGeoJson]: + """Searches Assets For Tile Tilematrixsetid As Path. + + Return a list of assets which overlap a given tile. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword collection_id: STAC Collection Identifier. Required. + :paramtype collection_id: str + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default value is None. - :paramtype max_size: int - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :return: list of TilerAssetGeoJson + :rtype: list[~azure.planetarycomputer.models.TilerAssetGeoJson] :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TilerAssetGeoJson]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_assets_for_tile_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + collection_id=collection_id, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.TilerAssetGeoJson], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals + def get_searches_tile_json_tms( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - width: int, - height: int, - format: str, - body: Union[_models.Feature, JSON, IO[bytes]], + search_id: str, + tile_matrix_set_id: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, - coordinate_reference_system: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> Iterator[bytes]: - """Geojson Crop. + ) -> _models.TileJsonMetadata: + """Searches TileJson Tilematrixsetid As Path. - Create image from a geojson feature. + Return TileJSON document for a search with TileMatrixSetId as path. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Image output size limit if width and height limits are not set. Default - value is None. - :paramtype max_size: int + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -10538,15 +34245,22 @@ def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10557,44 +34271,50 @@ def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) - _request = build_data_crop_geo_json_with_dimensions_request( - collection_id=collection_id, - item_id=item_id, - width=width, - height=height, - format=format, + _request = build_data_get_searches_tile_json_tms_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, + min_zoom=min_zoom, + max_zoom=max_zoom, + tile_format=tile_format, + tile_scale=tile_scale, + buffer=buffer, color_formula=color_formula, - coordinate_reference_system=coordinate_reference_system, + collection=collection, resampling=resampling, - max_size=max_size, + pixel_selection=pixel_selection, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, - content_type=content_type, + padding=padding, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10603,7 +34323,8 @@ def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -10619,400 +34340,359 @@ def crop_geo_json_with_dimensions( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def get_geo_json_statistics( + @distributed_trace + def get_searches_wmts_capabilities_tms( self, - collection_id: str, - item_id: str, - body: _models.Feature, + search_id: str, + tile_matrix_set_id: str, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - content_type: str = "application/json", + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + ) -> Iterator[bytes]: + """Searches Wmts Tilematrixsetid As Path. - Get Statistics from a geojson feature. + OGC WMTS endpoint with TileMatrixSetId as path. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param body: Request GeoJson body. Required. - :type body: ~azure.planetarycomputer.models.Feature - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. + :type tile_matrix_set_id: str + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). + _request = build_data_get_searches_wmts_capabilities_tms_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson - :raises ~azure.core.exceptions.HttpResponseError: - """ + response = pipeline_response.http_response - @overload - def get_geo_json_statistics( - self, - collection_id: str, - item_id: str, - body: JSON, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - Get Statistics from a geojson feature. + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param body: Request GeoJson body. Required. - :type body: JSON - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. + return deserialized # type: ignore - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). + @distributed_trace + def get_searches_info(self, search_id: str, **kwargs: Any) -> _models.TilerStacSearchRegistration: + """Searches Info. - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. + Get Search query metadata. - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :return: TilerStacSearchRegistration. The TilerStacSearchRegistration is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :rtype: ~azure.planetarycomputer.models.TilerStacSearchRegistration :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def get_geo_json_statistics( - self, - collection_id: str, - item_id: str, - body: IO[bytes], - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - Get Statistics from a geojson feature. + cls: ClsType[_models.TilerStacSearchRegistration] = kwargs.pop("cls", None) - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param body: Request GeoJson body. Required. - :type body: IO[bytes] - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). + _request = build_data_get_searches_info_request( + search_id=search_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. + response = pipeline_response.http_response - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerStacSearchRegistration, response.json()) - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson - :raises ~azure.core.exceptions.HttpResponseError: - """ + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def get_geo_json_statistics( # pylint: disable=too-many-locals + def get_searches_bbox_crop( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - body: Union[_models.Feature, JSON, IO[bytes]], + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, + destination_crs: Optional[str] = None, max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, **kwargs: Any - ) -> _models.StacItemStatisticsGeoJson: - """Geojson Statistics. + ) -> Iterator[bytes]: + """Searches Bbox. - Get Statistics from a geojson feature. + Create an image from part of a dataset (bounding box crop). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] - Required. - :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default to ``epsg:4326``. Default value is None. :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. - Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is - None. - :paramtype histogram_range: str - :return: StacItemStatisticsGeoJson. The StacItemStatisticsGeoJson is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.StacItemStatisticsGeoJson + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11023,39 +34703,53 @@ def get_geo_json_statistics( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StacItemStatisticsGeoJson] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_geo_json_statistics_request( - collection_id=collection_id, - item_id=item_id, + _request = build_data_get_searches_bbox_crop_request( + search_id=search_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, coordinate_reference_system=coordinate_reference_system, - resampling=resampling, + destination_crs=destination_crs, max_size=max_size, - categorical=categorical, - categories_pixels=categories_pixels, - percentiles=percentiles, - histogram_bins=histogram_bins, - histogram_range=histogram_range, - content_type=content_type, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -11064,7 +34758,8 @@ def get_geo_json_statistics( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -11080,32 +34775,211 @@ def get_geo_json_statistics( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.StacItemStatisticsGeoJson, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_info_geo_json( - self, collection_id: str, item_id: str, *, assets: Optional[List[str]] = None, **kwargs: Any - ) -> _models.TilerInfoGeoJsonFeature: - """Info Geojson. + def get_searches_bbox_crop_with_dimensions( # pylint: disable=too-many-locals + self, + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + width: int, + height: int, + format: str, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + destination_crs: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Searches Bbox With Dimensions. - Return Info Geojson. + Create an image from part of a dataset (bounding box crop with dimensions). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :param width: Force output image width. Required. + :type width: int + :param height: Force output image height. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] - :return: TilerInfoGeoJsonFeature. The TilerInfoGeoJsonFeature is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerInfoGeoJsonFeature + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11119,12 +34993,49 @@ def get_info_geo_json( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TilerInfoGeoJsonFeature] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_info_geo_json_request( - collection_id=collection_id, - item_id=item_id, + _request = build_data_get_searches_bbox_crop_with_dimensions_request( + search_id=search_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + width=width, + height=height, + format=format, + bidx=bidx, assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, + destination_crs=destination_crs, + max_size=max_size, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11134,7 +35045,8 @@ def get_info_geo_json( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -11150,32 +35062,99 @@ def get_info_geo_json( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerInfoGeoJsonFeature, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_item_asset_details( - self, collection_id: str, item_id: str, *, assets: Optional[List[str]] = None, **kwargs: Any - ) -> _models.TilerInfoMapResponse: - """Info. + def get_searches_bbox_assets( # pylint: disable=too-many-locals + self, + search_id: str, + minx: float, + miny: float, + maxx: float, + maxy: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + **kwargs: Any + ) -> List[Any]: + """Searches Assets For Bbox. - Return dataset's basic info. + Return a list of assets which overlap a given bounding box for a search. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :return: TilerInfoMapResponse. The TilerInfoMapResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerInfoMapResponse + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param minx: Bounding box min X. Required. + :type minx: float + :param miny: Bounding box min Y. Required. + :type miny: float + :param maxx: Bounding box max X. Required. + :type maxx: float + :param maxy: Bounding box max Y. Required. + :type maxy: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of any + :rtype: list[any] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11189,12 +35168,27 @@ def get_item_asset_details( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TilerInfoMapResponse] = kwargs.pop("cls", None) + cls: ClsType[List[Any]] = kwargs.pop("cls", None) - _request = build_data_get_item_asset_details_request( - collection_id=collection_id, - item_id=item_id, - assets=assets, + _request = build_data_get_searches_bbox_assets_request( + search_id=search_id, + minx=minx, + miny=miny, + maxx=maxx, + maxy=maxy, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11204,6 +35198,7 @@ def get_item_asset_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11221,94 +35216,316 @@ def get_item_asset_details( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.TilerInfoMapResponse, response.json()) + deserialized = _deserialize(List[Any], response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def get_part( # pylint: disable=too-many-locals + @overload + def crop_searches_feature_geo_json( # pylint: disable=too-many-locals + self, + search_id: str, + body: _models.Feature, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Searches Geojson Feature. + + Create image from a geojson feature (without format in path). + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_searches_feature_geo_json( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - minx: float, - miny: float, - maxx: float, - maxy: float, - format: str, + search_id: str, + body: JSON, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, max_size: Optional[int] = None, height: Optional[int] = None, width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", **kwargs: Any ) -> Iterator[bytes]: - """Part. + """Searches Geojson Feature. - Create image from part of a dataset. + Create image from a geojson feature (without format in path). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param minx: Bounding box min X. Required. - :type minx: float - :param miny: Bounding box min Y. Required. - :type miny: float - :param maxx: Bounding box max X. Required. - :type maxx: float - :param maxy: Bounding box max Y. Required. - :type maxy: float - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default to ``epsg:4326``. Default value is None. :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling :keyword max_size: Image output size limit if width and height limits are not set. Default value is None. :paramtype max_size: int @@ -11316,6 +35533,18 @@ def get_part( # pylint: disable=too-many-locals :paramtype height: int :keyword width: Width in pixels for the output image. Default value is None. :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -11348,184 +35577,162 @@ def get_part( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_part_request( - collection_id=collection_id, - item_id=item_id, - minx=minx, - miny=miny, - maxx=maxx, - maxy=maxy, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - color_formula=color_formula, - dst_crs=dst_crs, - coordinate_reference_system=coordinate_reference_system, - resampling=resampling, - max_size=max_size, - height=height, - width=width, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_part_with_dimensions( # pylint: disable=too-many-locals + @overload + def crop_searches_feature_geo_json( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, - minx: float, - miny: float, - maxx: float, - maxy: float, - width: int, - height: int, - format: str, + search_id: str, + body: IO[bytes], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + content_type: str = "application/json", **kwargs: Any ) -> Iterator[bytes]: - """Part. + """Searches Geojson Feature. - Create image from part of a dataset. + Create image from a geojson feature (without format in path). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param minx: Bounding box min X. Required. - :type minx: float - :param miny: Bounding box min Y. Required. - :type miny: float - :param maxx: Bounding box max X. Required. - :type maxx: float - :param maxy: Bounding box max Y. Required. - :type maxy: float - :param width: Width in pixels for the output image. Required. - :type width: int - :param height: Height in pixels for the output image. Required. - :type height: int - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default to ``epsg:4326``. Default value is None. :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling :keyword max_size: Image output size limit if width and height limits are not set. Default value is None. :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -11558,277 +35765,143 @@ def get_part_with_dimensions( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_part_with_dimensions_request( - collection_id=collection_id, - item_id=item_id, - minx=minx, - miny=miny, - maxx=maxx, - maxy=maxy, - width=width, - height=height, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - color_formula=color_formula, - dst_crs=dst_crs, - coordinate_reference_system=coordinate_reference_system, - resampling=resampling, - max_size=max_size, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_point( # pylint: disable=too-many-locals - self, - collection_id: str, - item_id: str, - longitude: float, - latitude: float, - *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - **kwargs: Any - ) -> _models.TilerCoreModelsResponsesPoint: - """Point. - - Get Point value for a dataset. - - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param longitude: Longitude. Required. - :type longitude: float - :param latitude: Latitude. Required. - :type latitude: float - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) - - _request = build_data_get_point_request( - collection_id=collection_id, - item_id=item_id, - longitude=longitude, - latitude=latitude, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - coordinate_reference_system=coordinate_reference_system, - resampling=resampling, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore @distributed_trace - def get_preview( # pylint: disable=too-many-locals + def crop_searches_feature_geo_json( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, + search_id: str, + body: Union[_models.Feature, JSON, IO[bytes]], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - format: Optional[Union[str, _models.TilerImageFormat]] = None, - color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, + coordinate_reference_system: Optional[str] = None, max_size: Optional[int] = None, height: Optional[int] = None, width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, **kwargs: Any ) -> Iterator[bytes]: - """Preview. + """Searches Geojson Feature. - Create preview of a dataset. + Create image from a geojson feature (without format in path). - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: - "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. - :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str :keyword max_size: Image output size limit if width and height limits are not set. Default value is None. :paramtype max_size: int @@ -11836,6 +35909,18 @@ def get_preview( # pylint: disable=too-many-locals :paramtype height: int :keyword width: Width in pixels for the output image. Default value is None. :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -11868,13 +35953,22 @@ def get_preview( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword format: Output image format. Known values are: "png", "npy", "tif", "jpeg", "jpg", + "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -11887,34 +35981,59 @@ def get_preview( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_preview_request( - collection_id=collection_id, - item_id=item_id, + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_searches_feature_geo_json_request( + search_id=search_id, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, - format=format, - color_formula=color_formula, - dst_crs=dst_crs, - resampling=resampling, + coordinate_reference_system=coordinate_reference_system, max_size=max_size, height=height, width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + destination_crs=destination_crs, + format=format, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11923,6 +36042,7 @@ def get_preview( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -11948,76 +36068,315 @@ def get_preview( # pylint: disable=too-many-locals response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def get_preview_with_format( # pylint: disable=too-many-locals + @overload + def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, + search_id: str, format: str, + body: _models.Feature, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - color_formula: Optional[str] = None, - dst_crs: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, + coordinate_reference_system: Optional[str] = None, max_size: Optional[int] = None, height: Optional[int] = None, width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any ) -> Iterator[bytes]: - """Preview. + """Searches Geojson Feature Crop With Format. - Create preview of a dataset. + Create image from a geojson feature with format. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str - :keyword dst_crs: Output Coordinate Reference System. Default value is None. - :paramtype dst_crs: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals + self, + search_id: str, + format: str, + body: JSON, + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Searches Geojson Feature Crop With Format. + + Create image from a geojson feature with format. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str :keyword max_size: Image output size limit if width and height limits are not set. Default value is None. :paramtype max_size: int @@ -12025,6 +36384,18 @@ def get_preview_with_format( # pylint: disable=too-many-locals :paramtype height: int :keyword width: Width in pixels for the output image. Default value is None. :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -12057,381 +36428,395 @@ def get_preview_with_format( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_preview_with_format_request( - collection_id=collection_id, - item_id=item_id, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - color_formula=color_formula, - dst_crs=dst_crs, - resampling=resampling, - max_size=max_size, - height=height, - width=width, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore @overload - def create_static_image( + def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals self, - collection_id: str, - body: _models.ImageParameters, + search_id: str, + format: str, + body: IO[bytes], *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. - - Create a new image export. - - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Image request body. Required. - :type body: ~azure.planetarycomputer.models.ImageParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_static_image( - self, collection_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. - - Create a new image export. - - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Image request body. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_static_image( - self, collection_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. + ) -> Iterator[bytes]: + """Searches Geojson Feature Crop With Format. - Create a new image export. + Create image from a geojson feature with format. - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Image request body. Required. + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_static_image( - self, collection_id: str, body: Union[_models.ImageParameters, JSON, IO[bytes]], **kwargs: Any - ) -> _models.ImageResponse: - """Create Static Image. - - Create a new image export. - - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param body: Image request body. Is one of the following types: ImageParameters, JSON, - IO[bytes] Required. - :type body: ~azure.planetarycomputer.models.ImageParameters or JSON or IO[bytes] - :return: ImageResponse. The ImageResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ImageResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImageResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_data_create_static_image_request( - collection_id=collection_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.ImageResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_static_image(self, collection_id: str, id: str, **kwargs: Any) -> Iterator[bytes]: - """Get Static Image. - - Fetch an existing image export by ID. - - :param collection_id: STAC Collection ID. Required. - :type collection_id: str - :param id: Image export ID. Required. - :type id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_static_image_request( - collection_id=collection_id, - id=id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore @distributed_trace - def list_statistics( # pylint: disable=too-many-locals + def crop_searches_feature_geo_json_format( # pylint: disable=too-many-locals self, - collection_id: str, - item_id: str, + search_id: str, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, max_size: Optional[int] = None, - categorical: Optional[bool] = None, - categories_pixels: Optional[List[str]] = None, - percentiles: Optional[List[int]] = None, - histogram_bins: Optional[str] = None, - histogram_range: Optional[str] = None, + height: Optional[int] = None, + width: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, **kwargs: Any - ) -> _models.TilerStacItemStatistics: - """Statistics. + ) -> Iterator[bytes]: + """Searches Geojson Feature Crop With Format. - Merged assets statistics. + Create image from a geojson feature with format. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword max_size: Maximum dimension in pixels for the source data used to calculate - statistics. Default value is None. - :paramtype max_size: int - :keyword categorical: Return statistics for categorical dataset. Default value is None. - :paramtype categorical: bool - :keyword categories_pixels: List of pixel categorical values for which to report counts. + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). Default value is None. - :paramtype categories_pixels: list[str] - :keyword percentiles: List of percentile values (default to [2, 98]). Default value is None. - :paramtype percentiles: list[int] - :keyword histogram_bins: Defines the number of equal-width bins in the given range (10, by - default). - - If bins is a sequence (comma ``,`` delimited values), it defines a monotonically - increasing array of bin edges, including the rightmost edge, allowing for - non-uniform bin widths. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is None. - :paramtype histogram_bins: str - :keyword histogram_range: Comma ``,`` delimited range of the bins. - - The lower and upper range of the bins. If not provided, range is simply - (a.min(), a.max()). - - Values outside the range are ignored. The first element of the range must be - less than or equal to the second. - range affects the automatic bin computation as well. - - link: `https://numpy.org/doc/stable/reference/generated/numpy.histogram.html - `_. Default value is + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is None. - :paramtype histogram_range: str - :return: TilerStacItemStatistics. The TilerStacItemStatistics is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerStacItemStatistics + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword height: Height in pixels for the output image. Default value is None. + :paramtype height: int + :keyword width: Width in pixels for the output image. Default value is None. + :paramtype width: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12442,28 +36827,59 @@ def list_statistics( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TilerStacItemStatistics] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_list_statistics_request( - collection_id=collection_id, - item_id=item_id, + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_searches_feature_geo_json_format_request( + search_id=search_id, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, - resampling=resampling, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + coordinate_reference_system=coordinate_reference_system, max_size=max_size, - categorical=categorical, - categories_pixels=categories_pixels, - percentiles=percentiles, - histogram_bins=histogram_bins, - histogram_range=histogram_range, + height=height, + width=width, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -12472,7 +36888,8 @@ def list_statistics( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -12488,95 +36905,156 @@ def list_statistics( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerStacItemStatistics, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def get_tile_json( # pylint: disable=too-many-locals + @overload + def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals self, - collection_id: str, - item_id: str, - tile_matrix_set_id: str, + search_id: str, + width: int, + height: int, + format: str, + body: _models.Feature, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, color_formula: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any - ) -> _models.TileJsonMetadata: - """TileJson Tilematrixsetid As Path. + ) -> Iterator[bytes]: + """Searches Geojson Feature Crop With Dimensions. - Return the TileJson Tilematrixsetid As a path. + Create image from a geojson feature with dimensions. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: ~azure.planetarycomputer.models.Feature + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword tile_format: Default will be automatically defined if the output image needs a mask - (png) or - not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". - Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -12609,171 +37087,161 @@ def get_tile_json( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) - - _request = build_data_get_tile_json_request( - collection_id=collection_id, - item_id=item_id, - tile_matrix_set_id=tile_matrix_set_id, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - tile_format=tile_format, - tile_scale=tile_scale, - min_zoom=min_zoom, - max_zoom=max_zoom, - buffer=buffer, - color_formula=color_formula, - resampling=resampling, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TileJsonMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized # type: ignore - - @distributed_trace - def get_tile( # pylint: disable=too-many-locals + @overload + def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals self, - collection_id: str, - item_id: str, - tile_matrix_set_id: str, - z: float, - x: float, - y: float, - scale: float, + search_id: str, + width: int, + height: int, format: str, + body: JSON, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - buffer: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, color_formula: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, - subdataset_name: Optional[str] = None, - subdataset_bands: Optional[List[str]] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any ) -> Iterator[bytes]: - """Tile Tilematrixsetid As Path. + """Searches Geojson Feature Crop With Dimensions. - Create map tile from a dataset. + Create image from a geojson feature with dimensions. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str - :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and - representing the scaleDenominator the tile. Required. - :type z: float - :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the - MatrixHeight-1 for the selected TileMatrix. Required. - :type x: float - :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the - MatrixWidth-1 for the selected TileMatrix. Required. - :type y: float - :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. - :type scale: float + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. :type format: str + :param body: Request GeoJson body. Required. + :type body: JSON + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -12806,179 +37274,348 @@ def get_tile( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. - :paramtype subdataset_name: str - :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is - None. - :paramtype subdataset_bands: list[str] + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_data_get_tile_request( - collection_id=collection_id, - item_id=item_id, - tile_matrix_set_id=tile_matrix_set_id, - z=z, - x=x, - y=y, - scale=scale, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - buffer=buffer, - color_formula=color_formula, - resampling=resampling, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, - subdataset_name=subdataset_name, - subdataset_bands=subdataset_bands, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", True) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() + @overload + def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals + self, + search_id: str, + width: int, + height: int, + format: str, + body: IO[bytes], + *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """Searches Geojson Feature Crop With Dimensions. - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + Create image from a geojson feature with dimensions. - return deserialized # type: ignore + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Required. + :type body: IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get_wmts_capabilities( # pylint: disable=too-many-locals + def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too-long,too-many-locals self, - collection_id: str, - item_id: str, - tile_matrix_set_id: str, + search_id: str, + width: int, + height: int, + format: str, + body: Union[_models.Feature, JSON, IO[bytes]], *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, + max_size: Optional[int] = None, color_formula: Optional[str] = None, + collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, rescale: Optional[List[str]] = None, color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + destination_crs: Optional[str] = None, **kwargs: Any ) -> Iterator[bytes]: - """Wmts Tilematrixsetid As Path. + """Searches Geojson Feature Crop With Dimensions. - OGC WMTS endpoint. + Create image from a geojson feature with dimensions. - :param collection_id: STAC Collection Identifier. Required. - :type collection_id: str - :param item_id: STAC Item Identifier. Required. - :type item_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param width: Width in pixels for the output image. Required. + :type width: int + :param height: Height in pixels for the output image. Required. + :type height: int + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :param body: Request GeoJson body. Is one of the following types: Feature, JSON, IO[bytes] + Required. + :type body: ~azure.planetarycomputer.models.Feature or JSON or IO[bytes] + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm :keyword algorithm_params: Terrain algorithm parameters. Default value is None. :paramtype algorithm_params: str - :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", - "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword max_size: Image output size limit if width and height limits are not set. Default + value is None. + :paramtype max_size: int :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. :paramtype rescale: list[str] @@ -13011,13 +37648,19 @@ def get_wmts_capabilities( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool + :keyword destination_crs: Output Coordinate Reference System. Default value is None. + :paramtype destination_crs: str :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -13030,35 +37673,59 @@ def get_wmts_capabilities( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_wmts_capabilities_request( - collection_id=collection_id, - item_id=item_id, - tile_matrix_set_id=tile_matrix_set_id, + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_crop_searches_feature_geo_json_width_by_height_request( + search_id=search_id, + width=width, + height=height, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, - tile_format=tile_format, - tile_scale=tile_scale, - min_zoom=min_zoom, - max_zoom=max_zoom, - buffer=buffer, + coordinate_reference_system=coordinate_reference_system, + max_size=max_size, color_formula=color_formula, + collection=collection, resampling=resampling, + pixel_selection=pixel_selection, rescale=rescale, color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + destination_crs=destination_crs, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13067,6 +37734,7 @@ def get_wmts_capabilities( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -13085,129 +37753,57 @@ def get_wmts_capabilities( # pylint: disable=too-many-locals response_headers = {} response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - deserialized = response.iter_bytes() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_class_map_legend( - self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any - ) -> _models.ClassMapLegendResponse: - """Get ClassMap Legend. - - Generate values and color swatches mapping for a given classmap. - - :param classmap_name: classmap name. Required. - :type classmap_name: str - :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. - :paramtype trim_start: int - :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. - :paramtype trim_end: int - :return: ClassMapLegendResponse. The ClassMapLegendResponse is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.ClassMapLegendResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ClassMapLegendResponse] = kwargs.pop("cls", None) - - _request = build_data_get_class_map_legend_request( - classmap_name=classmap_name, - trim_start=trim_start, - trim_end=trim_end, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.ClassMapLegendResponse, response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_interval_legend( - self, classmap_name: str, *, trim_start: Optional[int] = None, trim_end: Optional[int] = None, **kwargs: Any - ) -> List[List[List[int]]]: - """Get Interval Legend. - - Generate values and color swatches mapping for a given interval classmap. - - Returns a color map for intervals, where each interval is defined by: - - * A numeric range `[min, max]` representing the interval boundaries. - * An RGBA color `[red, green, blue, alpha]` associated with the interval. - - The response is a 2D array of interval definitions, where each element is a pair: - - * The first element is an array of two numbers `[min, max]` defining the interval. - * The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA - color. - - Example: - - .. code-block:: json - - [ - [ - [-2, 0], [0, 0, 0, 0] - ], - [ - [1, 32], [255, 255, 178, 255] - ] - ] + return cls(pipeline_response, deserialized, response_headers) # type: ignore - This example defines two intervals: + return deserialized # type: ignore - * The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black). - * The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow). + @distributed_trace + def get_searches_wmts_capabilities( + self, + search_id: str, + *, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """Searches Wmts. - :param classmap_name: classmap name. Required. - :type classmap_name: str - :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. - :paramtype trim_start: int - :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. - :paramtype trim_end: int - :return: list of list of list of int - :rtype: list[list[list[int]]] + OGC WMTS endpoint. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: + 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", + "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13221,12 +37817,15 @@ def get_interval_legend( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[List[List[int]]]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_interval_legend_request( - classmap_name=classmap_name, - trim_start=trim_start, - trim_end=trim_end, + _request = build_data_get_searches_wmts_capabilities_request( + search_id=search_id, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13236,7 +37835,8 @@ def get_interval_legend( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -13255,10 +37855,7 @@ def get_interval_legend( response_headers = {} response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[List[List[int]]], response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -13266,36 +37863,195 @@ def get_interval_legend( return deserialized # type: ignore @distributed_trace - def get_legend( + def get_searches_tile_json( # pylint: disable=too-many-locals self, - color_map_name: str, + search_id: str, *, - height: Optional[float] = None, - width: Optional[float] = None, - trim_start: Optional[int] = None, - trim_end: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, + tile_scale: Optional[int] = None, + min_zoom: Optional[int] = None, + max_zoom: Optional[int] = None, + padding: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection_id: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + rescale: Optional[List[str]] = None, + colormap_name: Optional[Union[str, _models.ColorMapNames]] = None, + colormap: Optional[str] = None, + return_mask: Optional[bool] = None, **kwargs: Any - ) -> Iterator[bytes]: - """Get Legend. - - Generate a legend image for a given colormap. + ) -> _models.TileJsonMetadata: + """Searches TileJson. - If the colormap has non-contiguous values at the beginning or end, - which aren't desired in the output image, they can be trimmed by specifying - the number of values to trim. + Return TileJSON document for a search. - :param color_map_name: The name of the registered colormap to generate a legend for. Required. - :type color_map_name: str - :keyword height: The output height of the legend image. Default value is None. - :paramtype height: float - :keyword width: The output width of the legend image. Default value is None. - :paramtype width: float - :keyword trim_start: Number of items to trim from the start of the cmap. Default value is None. - :paramtype trim_start: int - :keyword trim_end: Number of items to trim from the end of the cmap. Default value is None. - :paramtype trim_end: int - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword tile_format: Default will be automatically defined if the output image needs a mask + (png) or + not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + Default value is None. + :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles + (e.g., 1=256x256, 2=512x512). Default value is None. + :paramtype tile_scale: int + :keyword min_zoom: Overwrite default minzoom. Default value is None. + :paramtype min_zoom: int + :keyword max_zoom: Overwrite default maxzoom. Default value is None. + :paramtype max_zoom: int + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection_id: STAC Collection ID. Default value is None. + :paramtype collection_id: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword colormap_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype colormap_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword colormap: JSON encoded custom Colormap. Default value is None. + :paramtype colormap: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping + :rtype: ~azure.planetarycomputer.models.TileJsonMetadata :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13309,14 +38065,46 @@ def get_legend( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) - _request = build_data_get_legend_request( - color_map_name=color_map_name, - height=height, - width=width, - trim_start=trim_start, - trim_end=trim_end, + _request = build_data_get_searches_tile_json_request( + search_id=search_id, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + tile_matrix_set_id=tile_matrix_set_id, + tile_format=tile_format, + tile_scale=tile_scale, + min_zoom=min_zoom, + max_zoom=max_zoom, + padding=padding, + buffer=buffer, + color_formula=color_formula, + collection_id=collection_id, + resampling=resampling, + pixel_selection=pixel_selection, + algorithm=algorithm, + algorithm_params=algorithm_params, + rescale=rescale, + colormap_name=colormap_name, + colormap=colormap, + return_mask=return_mask, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13326,7 +38114,8 @@ def get_legend( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -13342,62 +38131,210 @@ def get_legend( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TileJsonMetadata, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def get_mosaics_assets_for_point( + def get_searches_tile_no_tms( # pylint: disable=too-many-locals self, search_id: str, - longitude: float, - latitude: float, + z: float, + x: float, + y: float, *, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, - coordinate_reference_system: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> List[_models.StacItemPointAsset]: - """Assets For Point. + ) -> Iterator[bytes]: + """Searches Tile Plain. - Return a list of assets for a given point. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param longitude: Longitude. Required. - :type longitude: float - :param latitude: Latitude. Required. - :type latitude: float - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). - Default value is None. + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default - to ``epsg:4326``. Default value is None. - :paramtype coordinate_reference_system: str - :return: list of StacItemPointAsset - :rtype: list[~azure.planetarycomputer.models.StacItemPointAsset] + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13411,18 +38348,47 @@ def get_mosaics_assets_for_point( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.StacItemPointAsset]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_assets_for_point_request( + _request = build_data_get_searches_tile_no_tms_request( search_id=search_id, - longitude=longitude, - latitude=latitude, + z=z, + x=x, + y=y, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, - coordinate_reference_system=coordinate_reference_system, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13432,7 +38398,8 @@ def get_mosaics_assets_for_point( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -13448,41 +38415,72 @@ def get_mosaics_assets_for_point( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[_models.StacItemPointAsset], response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_mosaics_assets_for_tile( + def get_searches_tile_no_tms_by_format( # pylint: disable=too-many-locals self, search_id: str, - tile_matrix_set_id: str, z: float, x: float, y: float, + format: str, *, - collection_id: str, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + scale: Optional[int] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> List[_models.TilerAssetGeoJson]: - """Assets For Tile Tilematrixsetid As Path. + ) -> Iterator[bytes]: + """Searches Tile Format. - Return a list of assets which overlap a given tile. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile. Required. :type z: float @@ -13492,26 +38490,140 @@ def get_mosaics_assets_for_tile( :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix. Required. :type y: float - :keyword collection_id: STAC Collection Identifier. Required. - :paramtype collection_id: str - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). - Default value is None. + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :return: list of TilerAssetGeoJson - :rtype: list[~azure.planetarycomputer.models.TilerAssetGeoJson] + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword scale: Numeric scale factor for the tile. Higher values produce larger tiles. Default + value is None. + :paramtype scale: int + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13525,20 +38637,47 @@ def get_mosaics_assets_for_tile( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.TilerAssetGeoJson]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_assets_for_tile_request( + _request = build_data_get_searches_tile_no_tms_by_format_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, z=z, x=x, y=y, - collection_id=collection_id, + format=format, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + scale=scale, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13548,7 +38687,8 @@ def get_mosaics_assets_for_tile( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -13564,221 +38704,215 @@ def get_mosaics_assets_for_tile( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(List[_models.TilerAssetGeoJson], response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_mosaics_search_info(self, search_id: str, **kwargs: Any) -> _models.TilerStacSearchRegistration: - """Info Search. - - Get Search query metadata. - - :param search_id: Search Id (pgSTAC Search Hash). Required. - :type search_id: str - :return: TilerStacSearchRegistration. The TilerStacSearchRegistration is compatible with - MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerStacSearchRegistration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TilerStacSearchRegistration] = kwargs.pop("cls", None) - - _request = build_data_get_mosaics_search_info_request( - search_id=search_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerStacSearchRegistration, response.json()) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def register_mosaics_search( - self, - *, - content_type: str = "application/json", - collections: Optional[List[str]] = None, - ids: Optional[List[str]] = None, - bounding_box: Optional[float] = None, - intersects: Optional[_models.Geometry] = None, - query: Optional[dict[str, Any]] = None, - filter: Optional[dict[str, Any]] = None, - datetime: Optional[str] = None, - sort_by: Optional[List[_models.StacSortExtension]] = None, - filter_language: Optional[Union[str, _models.FilterLanguage]] = None, - metadata: Optional[_models.MosaicMetadata] = None, - **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. - - Register a Search query. - - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is - None. - :paramtype collections: list[str] - :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. - :paramtype ids: list[str] - :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. - Default value is None. - :paramtype bounding_box: float - :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value - is None. - :paramtype intersects: ~azure.planetarycomputer.models.Geometry - :keyword query: Query. Default value is None. - :paramtype query: dict[str, any] - :keyword filter: Filter. Default value is None. - :paramtype filter: dict[str, any] - :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. - :paramtype datetime: str - :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. - :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] - :keyword filter_language: Query language format used in the filter parameter. Known values are: - "cql-json", "cql2-json", and "cql2-text". Default value is None. - :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage - :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. - :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def register_mosaics_search( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. - - Register a Search query. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def register_mosaics_search( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. - - Register a Search query. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def register_mosaics_search( # pylint: disable=too-many-locals + def get_searches_tile_no_tms_by_scale( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + search_id: str, + z: float, + x: float, + y: float, + scale: float, *, - collections: Optional[List[str]] = None, - ids: Optional[List[str]] = None, - bounding_box: Optional[float] = None, - intersects: Optional[_models.Geometry] = None, - query: Optional[dict[str, Any]] = None, - filter: Optional[dict[str, Any]] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, datetime: Optional[str] = None, - sort_by: Optional[List[_models.StacSortExtension]] = None, - filter_language: Optional[Union[str, _models.FilterLanguage]] = None, - metadata: Optional[_models.MosaicMetadata] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, + algorithm_params: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + format: Optional[Union[str, _models.TilerImageFormat]] = None, + buffer: Optional[float] = None, + color_formula: Optional[str] = None, + collection: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, + rescale: Optional[List[str]] = None, + color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, + color_map: Optional[str] = None, + return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> _models.TilerMosaicSearchRegistrationResponse: - """Register Search. + ) -> Iterator[bytes]: + """Searches Tile Scale. - Register a Search query. + The most basic operation. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :keyword collections: List of STAC collection IDs to include in the mosaic. Default value is + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is None. - :paramtype collections: list[str] - :keyword ids: List of specific STAC item IDs to include in the mosaic. Default value is None. - :paramtype ids: list[str] - :keyword bounding_box: Geographic bounding box to filter items [west, south, east, north]. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). Default value is None. - :paramtype bounding_box: float - :keyword intersects: GeoJSON geometry to spatially filter items by intersection. Default value - is None. - :paramtype intersects: ~azure.planetarycomputer.models.Geometry - :keyword query: Query. Default value is None. - :paramtype query: dict[str, any] - :keyword filter: Filter. Default value is None. - :paramtype filter: dict[str, any] - :keyword datetime: Temporal filter in RFC 3339 format or interval. Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. :paramtype datetime: str - :keyword sort_by: Criteria for ordering items in the mosaic. Default value is None. - :paramtype sort_by: list[~azure.planetarycomputer.models.StacSortExtension] - :keyword filter_language: Query language format used in the filter parameter. Known values are: - "cql-json", "cql2-json", and "cql2-text". Default value is None. - :paramtype filter_language: str or ~azure.planetarycomputer.models.FilterLanguage - :keyword metadata: Additional metadata to associate with the mosaic. Default value is None. - :paramtype metadata: ~azure.planetarycomputer.models.MosaicMetadata - :return: TilerMosaicSearchRegistrationResponse. The TilerMosaicSearchRegistrationResponse is - compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :keyword format: Output format for the tile or image (e.g., png, jpeg, webp). Known values are: + "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. + :paramtype format: str or ~azure.planetarycomputer.models.TilerImageFormat + :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. + Output + **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, + 1.0 = 258x258). Default value is None. + :paramtype buffer: float + :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color + `_). Default value is None. + :paramtype color_formula: str + :keyword collection: STAC Collection ID. Default value is None. + :paramtype collection: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. + :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection + :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple + bands. Default value is None. + :paramtype rescale: list[str] + :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", + "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", + "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", + "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", + "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", + "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", + "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", + "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", + "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", + "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", + "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", + "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", + "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", + "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", + "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", + "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", + "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", + "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", + "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", + "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", + "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", + "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", + "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", + "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", + "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", + "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", + "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", + "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", + "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. + :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames + :keyword color_map: JSON encoded custom Colormap. Default value is None. + :paramtype color_map: str + :keyword return_mask: Add mask to the output data. Default value is None. + :paramtype return_mask: bool + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13789,37 +38923,51 @@ def register_mosaics_search( # pylint: disable=too-many-locals } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TilerMosaicSearchRegistrationResponse] = kwargs.pop("cls", None) - - if body is _Unset: - body = { - "bbox": bounding_box, - "collections": collections, - "datetime_property": datetime, - "filter": filter, - "filter_lang": filter_language, - "ids": ids, - "intersects": intersects, - "metadata": metadata, - "query": query, - "sortby": sort_by, - } - body = {k: v for k, v in body.items() if v is not None} - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_register_mosaics_search_request( - content_type=content_type, + _request = build_data_get_searches_tile_no_tms_by_scale_request( + search_id=search_id, + z=z, + x=x, + y=y, + scale=scale, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + algorithm=algorithm, + algorithm_params=algorithm_params, + tile_matrix_set_id=tile_matrix_set_id, + format=format, + buffer=buffer, + color_formula=color_formula, + collection=collection, + resampling=resampling, + pixel_selection=pixel_selection, + rescale=rescale, + color_map_name=color_map_name, + color_map=color_map, + return_mask=return_mask, + padding=padding, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -13828,7 +38976,8 @@ def register_mosaics_search( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -13844,40 +38993,55 @@ def register_mosaics_search( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TilerMosaicSearchRegistrationResponse, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_mosaics_tile_json( # pylint: disable=too-many-locals + def get_searches_tile_no_tms_by_scale_and_format( # pylint: disable=name-too-long,too-many-locals self, search_id: str, - tile_matrix_set_id: str, + z: float, + x: float, + y: float, + scale: float, + format: str, *, + bidx: Optional[List[int]] = None, assets: Optional[List[str]] = None, expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, + no_data: Optional[str] = None, unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, algorithm_params: Optional[str] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - buffer: Optional[str] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, + buffer: Optional[float] = None, color_formula: Optional[str] = None, collection: Optional[str] = None, resampling: Optional[Union[str, _models.Resampling]] = None, @@ -13886,67 +39050,97 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, color_map: Optional[str] = None, return_mask: Optional[bool] = None, + padding: Optional[int] = None, **kwargs: Any - ) -> _models.TileJsonMetadata: - """TileJson Tilematrixsetid As Path. + ) -> Iterator[bytes]: + """Searches Tile. - Return TileJSON document for a searchId. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str + :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and + representing the scaleDenominator the tile. Required. + :type z: float + :param x: Column (X) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixHeight-1 for the selected TileMatrix. Required. + :type x: float + :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the + MatrixWidth-1 for the selected TileMatrix. Required. + :type y: float + :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. + :type scale: float + :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. + :type format: str + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] :keyword assets: Asset's names. Default value is None. :paramtype assets: list[str] :keyword expression: Band math expression between assets. Default value is None. :paramtype expression: str :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str + :paramtype asset_band_indices: list[str] :keyword asset_as_band: Asset as Band. Default value is None. :paramtype asset_as_band: bool :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float + :paramtype no_data: str :keyword unscale: Apply internal Scale or Offset. Default value is None. :paramtype unscale: bool - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). - Default value is None. + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword tile_format: Default will be automatically defined if the output image needs a mask - (png) or - not (jpeg). Known values are: "png", "npy", "tif", "jpeg", "jpg", "jp2", "webp", and "pngraw". + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", + "normalizedIndex", "terrarium", "terrainrgb", "slope", "cast", "ceil", "floor", "min", "max", + "median", "mean", "std", and "var". Default value is None. + :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm + :keyword algorithm_params: Terrain algorithm parameters. Default value is None. + :paramtype algorithm_params: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. Output **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, 1.0 = 258x258). Default value is None. - :paramtype buffer: str + :paramtype buffer: float :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color `_). Default value is None. :paramtype color_formula: str @@ -13956,7 +39150,8 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", - "lowest", "mean", "median", "stdev", "lastbandlow", and "lastbandhigh". Default value is None. + "lowest", "mean", "median", "stdev", "lastbandlow", "lastbandhigh", and "count". Default value + is None. :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple bands. Default value is None. @@ -13990,15 +39185,22 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. + "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", "ylorrd_r", "algae", "algae_r", + "amp", "amp_r", "balance", "balance_r", "curl", "curl_r", "deep", "deep_r", "delta", "delta_r", + "dense", "dense_r", "diff", "diff_r", "haline", "haline_r", "ice", "ice_r", "matter", + "matter_r", "oxy", "oxy_r", "phase", "phase_r", "rain", "rain_r", "solar", "solar_r", "speed", + "speed_r", "tarn", "tarn_r", "tempo", "tempo_r", "thermal", "thermal_r", "topo", "topo_r", + "turbid", "turbid_r", "turbo", and "turbo_r". Default value is None. :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames :keyword color_map: JSON encoded custom Colormap. Default value is None. :paramtype color_map: str :keyword return_mask: Add mask to the output data. Default value is None. :paramtype return_mask: bool - :return: TileJsonMetadata. The TileJsonMetadata is compatible with MutableMapping - :rtype: ~azure.planetarycomputer.models.TileJsonMetadata + :keyword padding: Padding to apply to each tile edge. Helps reduce resampling artefacts along + edges. Defaults to ``0``. Default value is None. + :paramtype padding: int + :return: Iterator[bytes] + :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14012,28 +39214,37 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TileJsonMetadata] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_tile_json_request( + _request = build_data_get_searches_tile_no_tms_by_scale_and_format_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, + z=z, + x=x, + y=y, + scale=scale, + format=format, + bidx=bidx, assets=assets, expression=expression, asset_band_indices=asset_band_indices, asset_as_band=asset_as_band, no_data=no_data, unscale=unscale, + reproject=reproject, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, algorithm=algorithm, algorithm_params=algorithm_params, - min_zoom=min_zoom, - max_zoom=max_zoom, - tile_format=tile_format, - tile_scale=tile_scale, + tile_matrix_set_id=tile_matrix_set_id, buffer=buffer, color_formula=color_formula, collection=collection, @@ -14043,6 +39254,7 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals color_map_name=color_map_name, color_map=color_map, return_mask=return_mask, + padding=padding, api_version=self._config.api_version, headers=_headers, params=_params, @@ -14052,7 +39264,8 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -14068,59 +39281,51 @@ def get_mosaics_tile_json( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.TileJsonMetadata, response.json()) + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def get_mosaics_tile( # pylint: disable=too-many-locals + def get_searches_assets_for_tile_no_tms( # pylint: disable=too-many-locals self, search_id: str, - tile_matrix_set_id: str, z: float, x: float, y: float, - scale: float, - format: str, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, exit_when_full: Optional[bool] = None, skip_covered: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - buffer: Optional[str] = None, - color_formula: Optional[str] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, collection: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - pixel_selection: Optional[Union[str, _models.PixelSelection]] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, + tile_matrix_set_id: Optional[Union[str, _models.TileMatrixSetId]] = None, **kwargs: Any - ) -> Iterator[bytes]: - """Tile Tilematrixsetid As Path. + ) -> List[Any]: + """Searches Assets For Tile. - Create map tile. + The most basic operation. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str :param z: Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile. Required. :type z: float @@ -14130,101 +39335,221 @@ def get_mosaics_tile( # pylint: disable=too-many-locals :param y: Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix. Required. :type y: float - :param scale: Numeric scale factor for the tile. Higher values produce larger tiles. Required. - :type scale: float - :param format: Output format for the tile or image (e.g., png, jpeg, webp). Required. - :type format: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword scan_limit: Return as soon as we scan N items (defaults to 10000 in PgSTAC). Default - value is None. + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. :paramtype scan_limit: int - :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100 in - PgSTAC). Default value is None. + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. :paramtype items_limit: int - :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5 in PgSTAC). + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported + (default: 'WebMercatorQuad'). Known values are: "CanadianNAD83_LCC", "EuropeanETRS89_LAEAQuad", + "LINZAntarticaMapTilegrid", "NZTM2000Quad", "UPSAntarcticWGS84Quad", "UPSArcticWGS84Quad", + "UTM31WGS84Quad", "WGS1984Quad", "WebMercatorQuad", "WorldCRS84Quad", and + "WorldMercatorWGS84Quad". Default value is None. + :paramtype tile_matrix_set_id: str or ~azure.planetarycomputer.models.TileMatrixSetId + :return: list of any + :rtype: list[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[Any]] = kwargs.pop("cls", None) + + _request = build_data_get_searches_assets_for_tile_no_tms_request( + search_id=search_id, + z=z, + x=x, + y=y, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + tile_matrix_set_id=tile_matrix_set_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[Any], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_searches_point( # pylint: disable=too-many-locals + self, + search_id: str, + longitude: float, + latitude: float, + *, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, + coordinate_reference_system: Optional[str] = None, + resampling: Optional[Union[str, _models.Resampling]] = None, + **kwargs: Any + ) -> _models.TilerCoreModelsResponsesPoint: + """Searches Point. + + Get Point value for a search dataset. + + :param search_id: Search Id (pgSTAC Search Hash). Required. + :type search_id: str + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. :paramtype time_limit: int - :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True in - PgSTAC). Default value is None. + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. :paramtype exit_when_full: bool :keyword skip_covered: Skip any items that would show up completely under the previous items (defaults - to True in PgSTAC). Default value is None. + to True). Default value is None. :paramtype skip_covered: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword collection: STAC Collection ID. Default value is None. + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. :paramtype collection: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword pixel_selection: Pixel selection method. Known values are: "first", "highest", - "lowest", "mean", "median", "stdev", "lastbandlow", and "lastbandhigh". Default value is None. - :paramtype pixel_selection: str or ~azure.planetarycomputer.models.PixelSelection - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", + "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. + :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling + :return: TilerCoreModelsResponsesPoint. The TilerCoreModelsResponsesPoint is compatible with + MutableMapping + :rtype: ~azure.planetarycomputer.models.TilerCoreModelsResponsesPoint :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14238,38 +39563,34 @@ def get_mosaics_tile( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.TilerCoreModelsResponsesPoint] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_tile_request( + _request = build_data_get_searches_point_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, - z=z, - x=x, - y=y, - scale=scale, - format=format, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, + longitude=longitude, + latitude=latitude, scan_limit=scan_limit, items_limit=items_limit, time_limit=time_limit, exit_when_full=exit_when_full, skip_covered=skip_covered, - algorithm=algorithm, - algorithm_params=algorithm_params, - buffer=buffer, - color_formula=color_formula, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, collection=collection, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, + coordinate_reference_system=coordinate_reference_system, resampling=resampling, - pixel_selection=pixel_selection, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, api_version=self._config.api_version, headers=_headers, params=_params, @@ -14279,7 +39600,8 @@ def get_mosaics_tile( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -14295,137 +39617,87 @@ def get_mosaics_tile( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TilerCoreModelsResponsesPoint, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals + def get_searches_point_with_assets( # pylint: disable=too-many-locals self, search_id: str, - tile_matrix_set_id: str, + longitude: float, + latitude: float, *, - assets: Optional[List[str]] = None, - expression: Optional[str] = None, - asset_band_indices: Optional[str] = None, - asset_as_band: Optional[bool] = None, - no_data: Optional[float] = None, - unscale: Optional[bool] = None, - algorithm: Optional[Union[str, _models.TerrainAlgorithm]] = None, - algorithm_params: Optional[str] = None, - tile_format: Optional[Union[str, _models.TilerImageFormat]] = None, - tile_scale: Optional[int] = None, - min_zoom: Optional[int] = None, - max_zoom: Optional[int] = None, - buffer: Optional[str] = None, - color_formula: Optional[str] = None, - resampling: Optional[Union[str, _models.Resampling]] = None, - rescale: Optional[List[str]] = None, - color_map_name: Optional[Union[str, _models.ColorMapNames]] = None, - color_map: Optional[str] = None, - return_mask: Optional[bool] = None, + scan_limit: Optional[int] = None, + items_limit: Optional[int] = None, + time_limit: Optional[int] = None, + exit_when_full: Optional[bool] = None, + skip_covered: Optional[bool] = None, + subdataset_name: Optional[str] = None, + subdataset_bands: Optional[List[int]] = None, + crs: Optional[str] = None, + datetime: Optional[str] = None, + sel: Optional[List[str]] = None, + sel_method: Optional[Union[str, _models.SelMethod]] = None, + collection: Optional[str] = None, + coordinate_reference_system: Optional[str] = None, **kwargs: Any - ) -> Iterator[bytes]: - """Wmts Tilematrixsetid As Path. + ) -> List[_models.StacItemPointAsset]: + """Searches Point Assets. - OGC WMTS endpoint. + Return a list of assets for a given point in a search. :param search_id: Search Id (pgSTAC Search Hash). Required. :type search_id: str - :param tile_matrix_set_id: Identifier selecting one of the TileMatrixSetId supported. Required. - :type tile_matrix_set_id: str - :keyword assets: Asset's names. Default value is None. - :paramtype assets: list[str] - :keyword expression: Band math expression between assets. Default value is None. - :paramtype expression: str - :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" - means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. - :paramtype asset_band_indices: str - :keyword asset_as_band: Asset as Band. Default value is None. - :paramtype asset_as_band: bool - :keyword no_data: Overwrite internal Nodata value. Default value is None. - :paramtype no_data: float - :keyword unscale: Apply internal Scale or Offset. Default value is None. - :paramtype unscale: bool - :keyword algorithm: Terrain algorithm name. Known values are: "hillshade", "contours", - "normalizedIndex", "terrarium", and "terrainrgb". Default value is None. - :paramtype algorithm: str or ~azure.planetarycomputer.models.TerrainAlgorithm - :keyword algorithm_params: Terrain algorithm parameters. Default value is None. - :paramtype algorithm_params: str - :keyword tile_format: Output image type. Default is png. Known values are: "png", "npy", "tif", - "jpeg", "jpg", "jp2", "webp", and "pngraw". Default value is None. - :paramtype tile_format: str or ~azure.planetarycomputer.models.TilerImageFormat - :keyword tile_scale: Tile scale factor affecting output size. Values > 1 produce larger tiles - (e.g., 1=256x256, 2=512x512). Default value is None. - :paramtype tile_scale: int - :keyword min_zoom: Overwrite default minzoom. Default value is None. - :paramtype min_zoom: int - :keyword max_zoom: Overwrite default maxzoom. Default value is None. - :paramtype max_zoom: int - :keyword buffer: Buffer on each side of the given tile. It must be a multiple of ``0.5``. - Output - **tilesize** will be expanded to ``tilesize + 2 * buffer`` (e.g 0.5 = 257x257, - 1.0 = 258x258). Default value is None. - :paramtype buffer: str - :keyword color_formula: rio-color formula (info: `https://github.com/mapbox/rio-color - `_). Default value is None. - :paramtype color_formula: str - :keyword resampling: Resampling method. Known values are: "nearest", "bilinear", "cubic", - "cubic_spline", "lanczos", "average", "mode", "gauss", and "rms". Default value is None. - :paramtype resampling: str or ~azure.planetarycomputer.models.Resampling - :keyword rescale: comma (',') delimited Min,Max range. Can set multiple time for multiple - bands. Default value is None. - :paramtype rescale: list[str] - :keyword color_map_name: Colormap name. Known values are: "accent", "accent_r", "afmhot", - "afmhot_r", "ai4g-lulc", "alos-fnf", "alos-palsar-mask", "autumn", "autumn_r", "binary", - "binary_r", "blues", "blues_r", "bone", "bone_r", "brbg", "brbg_r", "brg", "brg_r", "bugn", - "bugn_r", "bupu", "bupu_r", "bwr", "bwr_r", "c-cap", "cfastie", "chesapeake-lc-13", - "chesapeake-lc-7", "chesapeake-lu", "chloris-biomass", "cividis", "cividis_r", "cmrmap", - "cmrmap_r", "cool", "cool_r", "coolwarm", "coolwarm_r", "copper", "copper_r", "cubehelix", - "cubehelix_r", "dark2", "dark2_r", "drcog-lulc", "esa-cci-lc", "esa-worldcover", "flag", - "flag_r", "gap-lulc", "gist_earth", "gist_earth_r", "gist_gray", "gist_gray_r", "gist_heat", - "gist_heat_r", "gist_ncar", "gist_ncar_r", "gist_rainbow", "gist_rainbow_r", "gist_stern", - "gist_stern_r", "gist_yarg", "gist_yarg_r", "gnbu", "gnbu_r", "gnuplot", "gnuplot2", - "gnuplot2_r", "gnuplot_r", "gray", "gray_r", "greens", "greens_r", "greys", "greys_r", "hot", - "hot_r", "hsv", "hsv_r", "inferno", "inferno_r", "io-bii", "io-lulc", "io-lulc-9-class", "jet", - "jet_r", "jrc-change", "jrc-extent", "jrc-occurrence", "jrc-recurrence", "jrc-seasonality", - "jrc-transitions", "lidar-classification", "lidar-hag", "lidar-hag-alternative", - "lidar-intensity", "lidar-returns", "magma", "magma_r", "modis-10A1", "modis-10A2", - "modis-13A1|Q1", "modis-14A1|A2", "modis-15A2H|A3H", "modis-16A3GF-ET", "modis-16A3GF-PET", - "modis-17A2H|A2HGF", "modis-17A3HGF", "modis-64A1", "mtbs-severity", "nipy_spectral", - "nipy_spectral_r", "nrcan-lulc", "ocean", "ocean_r", "oranges", "oranges_r", "orrd", "orrd_r", - "paired", "paired_r", "pastel1", "pastel1_r", "pastel2", "pastel2_r", "pink", "pink_r", "piyg", - "piyg_r", "plasma", "plasma_r", "prgn", "prgn_r", "prism", "prism_r", "pubu", "pubu_r", - "pubugn", "pubugn_r", "puor", "puor_r", "purd", "purd_r", "purples", "purples_r", "qpe", - "rainbow", "rainbow_r", "rdbu", "rdbu_r", "rdgy", "rdgy_r", "rdpu", "rdpu_r", "rdylbu", - "rdylbu_r", "rdylgn", "rdylgn_r", "reds", "reds_r", "rplumbo", "schwarzwald", "seismic", - "seismic_r", "set1", "set1_r", "set2", "set2_r", "set3", "set3_r", "spectral", "spectral_r", - "spring", "spring_r", "summer", "summer_r", "tab10", "tab10_r", "tab20", "tab20_r", "tab20b", - "tab20b_r", "tab20c", "tab20c_r", "terrain", "terrain_r", "twilight", "twilight_r", - "twilight_shifted", "twilight_shifted_r", "usda-cdl", "usda-cdl-corn", "usda-cdl-cotton", - "usda-cdl-soybeans", "usda-cdl-wheat", "usgs-lcmap", "viirs-10a1", "viirs-13a1", "viirs-14a1", - "viirs-15a2H", "viridis", "viridis_r", "winter", "winter_r", "wistia", "wistia_r", "ylgn", - "ylgn_r", "ylgnbu", "ylgnbu_r", "ylorbr", "ylorbr_r", "ylorrd", and "ylorrd_r". Default value - is None. - :paramtype color_map_name: str or ~azure.planetarycomputer.models.ColorMapNames - :keyword color_map: JSON encoded custom Colormap. Default value is None. - :paramtype color_map: str - :keyword return_mask: Add mask to the output data. Default value is None. - :paramtype return_mask: bool - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :param longitude: Longitude. Required. + :type longitude: float + :param latitude: Latitude. Required. + :type latitude: float + :keyword scan_limit: Return as soon as we scan N items (defaults to 10000). Default value is + None. + :paramtype scan_limit: int + :keyword items_limit: Return as soon as we have N items per geometry (defaults to 100). Default + value is None. + :paramtype items_limit: int + :keyword time_limit: Return after N seconds to avoid long requests (defaults to 5). Default + value is None. + :paramtype time_limit: int + :keyword exit_when_full: Return as soon as the geometry is fully covered (defaults to True). + Default value is None. + :paramtype exit_when_full: bool + :keyword skip_covered: Skip any items that would show up completely under the previous items + (defaults + to True). Default value is None. + :paramtype skip_covered: bool + :keyword subdataset_name: The name of a subdataset within the asset. Default value is None. + :paramtype subdataset_name: str + :keyword subdataset_bands: The index of a subdataset band within the asset. Default value is + None. + :paramtype subdataset_bands: list[int] + :keyword crs: Coordinate Reference System. Default value is None. + :paramtype crs: str + :keyword datetime: Datetime to use for subsetting the asset. Default value is None. + :paramtype datetime: str + :keyword sel: Xarray Indexing using dimension names ``{dimension}={value}``. Default value is + None. + :paramtype sel: list[str] + :keyword sel_method: Xarray indexing method to use for inexact matches. Known values are: + "nearest", "linear", "bilinear", "cubic", "cubic_spline", "lanczos", "area", and "mode". + Default value is None. + :paramtype sel_method: str or ~azure.planetarycomputer.models.SelMethod + :keyword collection: STAC Collection Identifier. Default value is None. + :paramtype collection: str + :keyword coordinate_reference_system: Coordinate Reference System of the input coords. Default + to ``epsg:4326``. Default value is None. + :paramtype coordinate_reference_system: str + :return: list of StacItemPointAsset + :rtype: list[~azure.planetarycomputer.models.StacItemPointAsset] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14439,30 +39711,25 @@ def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.StacItemPointAsset]] = kwargs.pop("cls", None) - _request = build_data_get_mosaics_wmts_capabilities_request( + _request = build_data_get_searches_point_with_assets_request( search_id=search_id, - tile_matrix_set_id=tile_matrix_set_id, - assets=assets, - expression=expression, - asset_band_indices=asset_band_indices, - asset_as_band=asset_as_band, - no_data=no_data, - unscale=unscale, - algorithm=algorithm, - algorithm_params=algorithm_params, - tile_format=tile_format, - tile_scale=tile_scale, - min_zoom=min_zoom, - max_zoom=max_zoom, - buffer=buffer, - color_formula=color_formula, - resampling=resampling, - rescale=rescale, - color_map_name=color_map_name, - color_map=color_map, - return_mask=return_mask, + longitude=longitude, + latitude=latitude, + scan_limit=scan_limit, + items_limit=items_limit, + time_limit=time_limit, + exit_when_full=exit_when_full, + skip_covered=skip_covered, + subdataset_name=subdataset_name, + subdataset_bands=subdataset_bands, + crs=crs, + datetime=datetime, + sel=sel, + sel_method=sel_method, + collection=collection, + coordinate_reference_system=coordinate_reference_system, api_version=self._config.api_version, headers=_headers, params=_params, @@ -14472,7 +39739,8 @@ def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", True) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -14488,25 +39756,25 @@ def get_mosaics_wmts_capabilities( # pylint: disable=too-many-locals map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - response_headers = {} - response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) - - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.StacItemPointAsset], response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore -class SharedAccessSignatureOperations: +class SasOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.planetarycomputer.PlanetaryComputerProClient`'s - :attr:`shared_access_signature` attribute. + :attr:`sas` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -14550,7 +39818,7 @@ def get_sign( cls: ClsType[_models.SharedAccessSignatureSignedLink] = kwargs.pop("cls", None) - _request = build_shared_access_signature_get_sign_request( + _request = build_sas_get_sign_request( href=href, duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, @@ -14562,6 +39830,7 @@ def get_sign( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14579,7 +39848,7 @@ def get_sign( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SharedAccessSignatureSignedLink, response.json()) @@ -14621,7 +39890,7 @@ def get_token( cls: ClsType[_models.SharedAccessSignatureToken] = kwargs.pop("cls", None) - _request = build_shared_access_signature_get_token_request( + _request = build_sas_get_token_request( collection_id=collection_id, duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, @@ -14633,6 +39902,7 @@ def get_token( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -14650,7 +39920,7 @@ def get_token( raise HttpResponseError(response=response) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SharedAccessSignatureToken, response.json()) @@ -14688,7 +39958,7 @@ def revoke_token( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_shared_access_signature_revoke_token_request( + _request = build_sas_revoke_token_request( duration_in_minutes=duration_in_minutes, api_version=self._config.api_version, headers=_headers, diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete.py new file mode 100644 index 000000000000..a882070275c5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_operations_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.ingestion.cancel_operation( + operation_id="00000000-0000-0000-0000-000000000000", + ) + + +# x-ms-original-file: 2026-04-15/IngestionOperations_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete_all.py new file mode 100644 index 000000000000..50cd47953ec0 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_delete_all.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_operations_delete_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.ingestion.cancel_all_operations() + + +# x-ms-original-file: 2026-04-15/IngestionOperations_DeleteAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_get.py new file mode 100644 index 000000000000..87d2950e3f9a --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_operations_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.get_operation( + operation_id="00000000-0000-0000-0000-000000000000", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/IngestionOperations_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_list.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_list.py new file mode 100644 index 000000000000..fde2907a3d82 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_operations_list.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_operations_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.list_operations() + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-15/IngestionOperations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_create.py new file mode 100644 index 000000000000..c5678142541d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_create.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_runs_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.create_run( + collection_id="naip-atl", + ingestion_id="00000000-0000-0000-0000-000000000000", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/IngestionRuns_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_get.py new file mode 100644 index 000000000000..7174266701d8 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_runs_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.get_run( + collection_id="naip-atl", + ingestion_id="00000000-0000-0000-0000-000000000000", + run_id="00000000-0000-0000-0000-000000000000", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/IngestionRuns_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_list.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_list.py new file mode 100644 index 000000000000..2c0b0b7e0f8e --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_runs_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_runs_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.list_runs( + collection_id="naip-atl", + ingestion_id="00000000-0000-0000-0000-000000000000", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-15/IngestionRuns_List.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_create.py new file mode 100644 index 000000000000..76917025c52f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_create.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_sources_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.create_source( + body={ + "connectionInfo": { + "containerUrl": "https://SANITIZED.blob.core.windows.net/sample-container", + "sasToken": "sv=2021-01-01&st=Sanitized&se=Sanitized&sr=c&sp=rl&sig=Sanitized", + }, + "id": "00000000-0000-0000-0000-000000000000", + "kind": "SasToken", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/IngestionSources_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_delete.py new file mode 100644 index 000000000000..5e9497c5285c --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_delete.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_sources_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.ingestion.delete_source( + id="00000000-0000-0000-0000-000000000000", + ) + + +# x-ms-original-file: 2026-04-15/IngestionSources_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_get.py new file mode 100644 index 000000000000..37ffc1c2ea1c --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_sources_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.get_source( + id="00000000-0000-0000-0000-000000000000", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/IngestionSources_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list.py new file mode 100644 index 000000000000..35d372f1b912 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_sources_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.list_sources() + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-15/IngestionSources_List.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list_managed_identities.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list_managed_identities.py new file mode 100644 index 000000000000..167e0cf72fce --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_list_managed_identities.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_sources_list_managed_identities.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.list_managed_identities() + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-15/IngestionSources_ListManagedIdentities.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_replace.py new file mode 100644 index 000000000000..ef0a24978483 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestion_sources_replace.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestion_sources_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.replace_source( + id="00000000-0000-0000-0000-000000000000", + body={ + "connectionInfo": { + "containerUrl": "https://SANITIZED.blob.core.windows.net/sample-container", + "sasToken": "sp=rl&st=Sanitized&se=Sanitized&sv=Sanitized&sr=c&sig=Sanitized", + }, + "id": "00000000-0000-0000-0000-000000000000", + "kind": "SasToken", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/IngestionSources_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_create.py new file mode 100644 index 000000000000..ba83d6d2455d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_create.py @@ -0,0 +1,49 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestions_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.create( + collection_id="naip-atl", + body={ + "displayName": "Ingestion", + "importType": "StaticCatalog", + "keepOriginalAssets": True, + "skipExistingItems": True, + "sourceCatalogUrl": "https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/Ingestions_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_delete.py new file mode 100644 index 000000000000..4d6706091706 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestions_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.ingestion.begin_delete( + collection_id="naip-atl", + ingestion_id="00000000-0000-0000-0000-000000000000", + ).result() + + +# x-ms-original-file: 2026-04-15/Ingestions_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_get.py new file mode 100644 index 000000000000..6b305ff3a08b --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestions_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.get( + collection_id="naip-atl", + ingestion_id="00000000-0000-0000-0000-000000000000", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/Ingestions_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_list.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_list.py new file mode 100644 index 000000000000..866bbf69909f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestions_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.list( + collection_id="naip-atl", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-04-15/Ingestions_List.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_stac_create_geoparquet.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_stac_create_geoparquet.py new file mode 100644 index 000000000000..3eca0bdf1dee --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_stac_create_geoparquet.py @@ -0,0 +1,49 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestions_stac_create_geoparquet.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.create( + collection_id="naip-atl", + body={ + "displayName": "Geoparquet Ingestion", + "importType": "StacGeoparquet", + "keepOriginalAssets": True, + "skipExistingItems": True, + "stacGeoparquetUrl": "https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/items.parquet", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/Ingestions_StacCreateGeoparquet.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_update.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_update.py new file mode 100644 index 000000000000..5cfe247d7020 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/ingestions_update.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python ingestions_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.ingestion.update( + collection_id="naip-atl", + ingestion_id="00000000-0000-0000-0000-000000000000", + body={"displayName": "Updated Ingestion Name", "importType": "StaticCatalog"}, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/Ingestions_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_class_map_legends_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_class_map_legends_get.py new file mode 100644 index 000000000000..bd479094b95e --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_class_map_legends_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python maps_class_map_legends_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_class_map_legend( + classmap_name="mtbs-severity", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MapsClassMapLegends_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_interval_legends_get_by_class_map_name.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_interval_legends_get_by_class_map_name.py new file mode 100644 index 000000000000..f4eca8788173 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_interval_legends_get_by_class_map_name.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python maps_interval_legends_get_by_class_map_name.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_interval_legend( + classmap_name="modis-64A1", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MapsIntervalLegends_GetByClassMapName.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_legends_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_legends_get.py new file mode 100644 index 000000000000..d47f17dc0ab2 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/maps_legends_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python maps_legends_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_legend( + color_map_name="rdylgn", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MapsLegends_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_bbox_get_bbox_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_bbox_get_bbox_assets.py new file mode 100644 index 000000000000..1f5d645033e6 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_bbox_get_bbox_assets.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_assets_for_bbox_get_bbox_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_assets_for_bbox( + collection_id="naip-atl", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsAssetsForBbox_GetBboxAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tile_matrix_sets_get_zxy_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tile_matrix_sets_get_zxy_assets.py new file mode 100644 index 000000000000..ea8ad243812e --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tile_matrix_sets_get_zxy_assets.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_assets_for_tile_matrix_sets_get_zxy_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_assets_for_tile( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsAssetsForTileMatrixSets_GetZxyAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tiles_get_zxy_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tiles_get_zxy_assets.py new file mode 100644 index 000000000000..5c0c12c0464a --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_assets_for_tiles_get_zxy_assets.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_assets_for_tiles_get_zxy_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_assets_for_tile_no_tms( + collection_id="naip-atl", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsAssetsForTiles_GetZxyAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_get_cropped_to_bounding_box.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_get_cropped_to_bounding_box.py new file mode 100644 index 000000000000..af4012c5f950 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_get_cropped_to_bounding_box.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_bbox_get_cropped_to_bounding_box.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_bbox_crop( + collection_id="naip-atl", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsBbox_GetCroppedToBoundingBox.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py new file mode 100644 index 000000000000..47274b0e04e0 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_bbox_crop_with_dimensions( + collection_id="naip-atl", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + width=256, + height=256, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsBboxWithDimensions_GetCroppedToBoundingBoxWidthByHeight.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_crop.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_crop.py new file mode 100644 index 000000000000..b7f63cc34ee2 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_crop.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_feature_geo_json_crop.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_collection_feature_geo_json( + collection_id="naip-atl", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsFeatureGeoJson_Crop.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_format_crop_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_format_crop_format.py new file mode 100644 index 000000000000..b8ff4f698fde --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_format_crop_format.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_feature_geo_json_format_crop_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_collection_feature_geo_json_format( + collection_id="naip-atl", + format="png", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsFeatureGeoJsonFormat_CropFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_width_by_height_crop_width_by_height_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_width_by_height_crop_width_by_height_format.py new file mode 100644 index 000000000000..c94315dc621a --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_feature_geo_json_width_by_height_crop_width_by_height_format.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_feature_geo_json_width_by_height_crop_width_by_height_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_collection_feature_geo_json_width_by_height( + collection_id="naip-atl", + width=256, + height=256, + format="png", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsFeatureGeoJsonWidthByHeight_CropWidthByHeightFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_info_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_info_get.py new file mode 100644 index 000000000000..1365de7c70da --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_info_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_info_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_info( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsInfo_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_assets_get_point_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_assets_get_point_assets.py new file mode 100644 index 000000000000..a5fb152c2153 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_assets_get_point_assets.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_point_assets_get_point_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_point_assets( + collection_id="naip-atl", + longitude=-122.4194, + latitude=37.7749, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsPointAssets_GetPointAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_get_point.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_get_point.py new file mode 100644 index 000000000000..17e47d16db4d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_point_get_point.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_point_get_point.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_point( + collection_id="naip-atl", + longitude=-84.386, + latitude=33.676, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsPoint_GetPoint.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_json_get.py new file mode 100644 index 000000000000..eaa019d1cec6 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_json_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_json( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_format_get_zxy_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_format_get_zxy_by_format.py new file mode 100644 index 000000000000..bea017b9275d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_format_get_zxy_by_format.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_matrix_sets_format_get_zxy_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_by_format( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileMatrixSetsFormat_GetZxyByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_get_zxy_scale_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_get_zxy_scale_by_format.py new file mode 100644 index 000000000000..18b3d7cf35b4 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_get_zxy_scale_by_format.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_matrix_sets_get_zxy_scale_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_by_scale_and_format( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + scale=1, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileMatrixSets_GetZxyScaleByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_plain_get_zxy.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_plain_get_zxy.py new file mode 100644 index 000000000000..fd5e0d769117 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_plain_get_zxy.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_matrix_sets_plain_get_zxy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileMatrixSetsPlain_GetZxy.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_scale_get_zxy_by_scale.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_scale_get_zxy_by_scale.py new file mode 100644 index 000000000000..5fc45177d040 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_scale_get_zxy_by_scale.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_matrix_sets_scale_get_zxy_by_scale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_by_scale( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + scale=1, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileMatrixSetsScale_GetZxyByScale.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_tile_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_tile_json_get.py new file mode 100644 index 000000000000..7c400b6d6911 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_matrix_sets_tile_json_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_matrix_sets_tile_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_json_tms( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileMatrixSetsTileJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_list_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_list_get.py new file mode 100644 index 000000000000..86113fafdd8c --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_list_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_set_list_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.list_collection_tilesets( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileSetList_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_metadata_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_metadata_get.py new file mode 100644 index 000000000000..ac5abde962e7 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tile_set_metadata_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tile_set_metadata_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tileset_metadata( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTileSetMetadata_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_format_get_zxy_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_format_get_zxy_by_format.py new file mode 100644 index 000000000000..c6a58140ff11 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_format_get_zxy_by_format.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tiles_format_get_zxy_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_no_tms_by_format( + collection_id="naip-atl", + z=13, + x=2174, + y=3282, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTilesFormat_GetZxyByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_get_zxy_scale_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_get_zxy_scale_by_format.py new file mode 100644 index 000000000000..4dae9c07b496 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_get_zxy_scale_by_format.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tiles_get_zxy_scale_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_no_tms_by_scale_and_format( + collection_id="naip-atl", + z=13, + x=2174, + y=3282, + scale=1, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTiles_GetZxyScaleByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_plain_get_zxy.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_plain_get_zxy.py new file mode 100644 index 000000000000..e40b4229b301 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_plain_get_zxy.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tiles_plain_get_zxy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_no_tms( + collection_id="naip-atl", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTilesPlain_GetZxy.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_scale_get_zxy_by_scale.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_scale_get_zxy_by_scale.py new file mode 100644 index 000000000000..fd71920da561 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_tiles_scale_get_zxy_by_scale.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_tiles_scale_get_zxy_by_scale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_tile_no_tms_by_scale( + collection_id="naip-atl", + z=13, + x=2174, + y=3282, + scale=1, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsTilesScale_GetZxyByScale.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_get_capabilities_xml.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_get_capabilities_xml.py new file mode 100644 index 000000000000..47ca2b6a7843 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_get_capabilities_xml.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_wmts_get_capabilities_xml.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_wmts_capabilities( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsWmts_GetCapabilitiesXml.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_tile_matrix_sets_get_capabilities_xml.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_tile_matrix_sets_get_capabilities_xml.py new file mode 100644 index 000000000000..009e407dbdd4 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_collections_wmts_tile_matrix_sets_get_capabilities_xml.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_collections_wmts_tile_matrix_sets_get_capabilities_xml.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_collection_wmts_capabilities_tms( + collection_id="naip-atl", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicCollectionsWmtsTileMatrixSets_GetCapabilitiesXml.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_asset_statistics_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_asset_statistics_get_all.py new file mode 100644 index 000000000000..f574064263f1 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_asset_statistics_get_all.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_asset_statistics_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_asset_statistics( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsAssetStatistics_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_available_assets_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_available_assets_get_all.py new file mode 100644 index 000000000000..a4a03734ea82 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_available_assets_get_all.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_available_assets_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.list_item_available_assets( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsAvailableAssets_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_get_cropped_to_bounding_box.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_get_cropped_to_bounding_box.py new file mode 100644 index 000000000000..f70bc297d0c5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_get_cropped_to_bounding_box.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_bbox_get_cropped_to_bounding_box.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_bbox_crop( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsBbox_GetCroppedToBoundingBox.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py new file mode 100644 index 000000000000..a521022f54ee --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_bbox_crop_with_dimensions( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + width=256, + height=256, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsBboxWithDimensions_GetCroppedToBoundingBoxWidthByHeight.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bounds_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bounds_get_all.py new file mode 100644 index 000000000000..d653fbb96781 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_bounds_get_all.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_bounds_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_bounds( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsBounds_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_crop.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_crop.py new file mode 100644 index 000000000000..e18be48f3b42 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_crop.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_feature_geo_json_crop.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_feature_geo_json( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsFeatureGeoJson_Crop.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_format_crop_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_format_crop_format.py new file mode 100644 index 000000000000..49357da8dd11 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_format_crop_format.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_feature_geo_json_format_crop_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_feature_geo_json_format( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + format="png", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsFeatureGeoJsonFormat_CropFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_width_by_height_crop_width_by_height_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_width_by_height_crop_width_by_height_format.py new file mode 100644 index 000000000000..640152c61cf5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_feature_geo_json_width_by_height_crop_width_by_height_format.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_feature_geo_json_width_by_height_crop_width_by_height_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_feature_geo_json_width_by_height( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + width=256, + height=256, + format="png", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsFeatureGeoJsonWidthByHeight_CropWidthByHeightFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_geo_json_statistics_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_geo_json_statistics_get.py new file mode 100644 index 000000000000..e2def44c9c46 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_geo_json_statistics_get.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_geo_json_statistics_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_geo_json_statistics( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsGeoJsonStatistics_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_geo_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_geo_json_get.py new file mode 100644 index 000000000000..9ef34048414d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_geo_json_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_info_geo_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_info_geo_json( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsInfoGeoJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_get.py new file mode 100644 index 000000000000..4d662832545f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_info_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_info_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_info( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsInfo_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_point_get_point.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_point_get_point.py new file mode 100644 index 000000000000..c9bfb3c91f35 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_point_get_point.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_point_get_point.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_point( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + longitude=-84.386, + latitude=33.676, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsPoint_GetPoint.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_format_get_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_format_get_format.py new file mode 100644 index 000000000000..069ba98c1906 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_format_get_format.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_preview_format_get_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_preview_with_format( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + format="jpeg", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsPreviewFormat_GetFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_get.py new file mode 100644 index 000000000000..0de2f24629d5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_preview_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_preview_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_preview( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsPreview_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_statistics_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_statistics_get_all.py new file mode 100644 index 000000000000..ea2301f011a3 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_statistics_get_all.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_statistics_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.list_item_statistics( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsStatistics_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_json_get.py new file mode 100644 index 000000000000..fe5fc5247015 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_json_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_tile_json( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_format_get_zxy_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_format_get_zxy_by_format.py new file mode 100644 index 000000000000..c67be0a4ee47 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_format_get_zxy_by_format.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_matrix_sets_format_get_zxy_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_by_format( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4349, + y=6564, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileMatrixSetsFormat_GetZxyByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_plain_get_zxy.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_plain_get_zxy.py new file mode 100644 index 000000000000..8d0572281ef2 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_plain_get_zxy.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_matrix_sets_plain_get_zxy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4349, + y=6564, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileMatrixSetsPlain_GetZxy.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_by_format_get_zxy_scale_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_by_format_get_zxy_scale_by_format.py new file mode 100644 index 000000000000..9317dff72f57 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_by_format_get_zxy_scale_by_format.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_matrix_sets_scale_by_format_get_zxy_scale_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_by_scale_and_format( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4349, + y=6564, + scale=2, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileMatrixSetsScaleByFormat_GetZxyScaleByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_get_zxy_by_scale.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_get_zxy_by_scale.py new file mode 100644 index 000000000000..7c464bbe0c55 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_scale_get_zxy_by_scale.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_matrix_sets_scale_get_zxy_by_scale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_by_scale( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4349, + y=6564, + scale=2, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileMatrixSetsScale_GetZxyByScale.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_tile_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_tile_json_get.py new file mode 100644 index 000000000000..bd76931ca631 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_matrix_sets_tile_json_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_matrix_sets_tile_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_tile_json_tms( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileMatrixSetsTileJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_list_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_list_get.py new file mode 100644 index 000000000000..93e1c07cf89e --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_list_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_set_list_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.list_tilesets( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileSetList_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_metadata_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_metadata_get.py new file mode 100644 index 000000000000..6206d7de140d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tile_set_metadata_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tile_set_metadata_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tileset_metadata( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTileSetMetadata_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_format_get_zxy_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_format_get_zxy_by_format.py new file mode 100644 index 000000000000..60a73a0165e4 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_format_get_zxy_by_format.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tiles_format_get_zxy_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_no_tms_by_format( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + z=14, + x=4349, + y=6564, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTilesFormat_GetZxyByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_plain_get_zxy.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_plain_get_zxy.py new file mode 100644 index 000000000000..57bfbc66eba5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_plain_get_zxy.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tiles_plain_get_zxy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_no_tms( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + z=14, + x=4349, + y=6564, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTilesPlain_GetZxy.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_by_format_get_zxy_scale_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_by_format_get_zxy_scale_by_format.py new file mode 100644 index 000000000000..9ebb358e4eee --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_by_format_get_zxy_scale_by_format.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tiles_scale_by_format_get_zxy_scale_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_no_tms_by_scale_and_format( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + z=14, + x=4349, + y=6564, + scale=2, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTilesScaleByFormat_GetZxyScaleByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_get_zxy_by_scale.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_get_zxy_by_scale.py new file mode 100644 index 000000000000..524288fb9e32 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_tiles_scale_get_zxy_by_scale.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_tiles_scale_get_zxy_by_scale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_no_tms_by_scale( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + z=14, + x=4349, + y=6564, + scale=2, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsTilesScale_GetZxyByScale.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_get_capabilities_xml.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_get_capabilities_xml.py new file mode 100644 index 000000000000..b4751ff1678a --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_get_capabilities_xml.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_wmts_get_capabilities_xml.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_wmts_capabilities( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsWmts_GetCapabilitiesXml.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_tile_matrix_sets_get_capabilities_xml.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_tile_matrix_sets_get_capabilities_xml.py new file mode 100644 index 000000000000..1cb0f6b4a35f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_items_wmts_tile_matrix_sets_get_capabilities_xml.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_items_wmts_tile_matrix_sets_get_capabilities_xml.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_item_wmts_capabilities_tms( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicItemsWmtsTileMatrixSets_GetCapabilitiesXml.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_bbox_get_bbox_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_bbox_get_bbox_assets.py new file mode 100644 index 000000000000..dcbcd11b7194 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_bbox_get_bbox_assets.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_assets_for_bbox_get_bbox_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_bbox_assets( + search_id="abc123def456", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesAssetsForBbox_GetBboxAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tile_matrix_sets_get_zxy_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tile_matrix_sets_get_zxy_assets.py new file mode 100644 index 000000000000..a9f439a7d4d3 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tile_matrix_sets_get_zxy_assets.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_assets_for_tile_matrix_sets_get_zxy_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_assets_for_tile( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesAssetsForTileMatrixSets_GetZxyAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tiles_get_zxy_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tiles_get_zxy_assets.py new file mode 100644 index 000000000000..f169e0010bbb --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_assets_for_tiles_get_zxy_assets.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_assets_for_tiles_get_zxy_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_assets_for_tile_no_tms( + search_id="ba13fc7947b9b585690d84ee61aaa653", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesAssetsForTiles_GetZxyAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_get_cropped_to_bounding_box.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_get_cropped_to_bounding_box.py new file mode 100644 index 000000000000..76e6a6b94b59 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_get_cropped_to_bounding_box.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_bbox_get_cropped_to_bounding_box.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_bbox_crop( + search_id="ba13fc7947b9b585690d84ee61aaa653", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesBbox_GetCroppedToBoundingBox.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py new file mode 100644 index 000000000000..991109288eb5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_bbox_with_dimensions_get_cropped_to_bounding_box_width_by_height.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_bbox_crop_with_dimensions( + search_id="ba13fc7947b9b585690d84ee61aaa653", + minx=-122.5, + miny=37.7, + maxx=-122.3, + maxy=37.8, + width=256, + height=256, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesBboxWithDimensions_GetCroppedToBoundingBoxWidthByHeight.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_crop.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_crop.py new file mode 100644 index 000000000000..8649ce826a8e --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_crop.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_feature_geo_json_crop.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_searches_feature_geo_json( + search_id="ba13fc7947b9b585690d84ee61aaa653", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesFeatureGeoJson_Crop.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_format_crop_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_format_crop_format.py new file mode 100644 index 000000000000..7225c83dc68d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_format_crop_format.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_feature_geo_json_format_crop_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_searches_feature_geo_json_format( + search_id="ba13fc7947b9b585690d84ee61aaa653", + format="png", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesFeatureGeoJsonFormat_CropFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_width_by_height_crop_width_by_height_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_width_by_height_crop_width_by_height_format.py new file mode 100644 index 000000000000..2cbcbf9e0eb5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_feature_geo_json_width_by_height_crop_width_by_height_format.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_feature_geo_json_width_by_height_crop_width_by_height_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.crop_searches_feature_geo_json_width_by_height( + search_id="ba13fc7947b9b585690d84ee61aaa653", + width=256, + height=256, + format="png", + body={ + "geometry": { + "coordinates": [ + [ + [-84.3906, 33.6714], + [-84.3814, 33.6714], + [-84.3814, 33.6806], + [-84.3906, 33.6806], + [-84.3906, 33.6714], + ] + ], + "type": "Polygon", + }, + "properties": {}, + "type": "Feature", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesFeatureGeoJsonWidthByHeight_CropWidthByHeightFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_info_search_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_info_search_get.py new file mode 100644 index 000000000000..1342e2936e04 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_info_search_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_info_search_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_info( + search_id="ba13fc7947b9b585690d84ee61aaa653", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesInfoSearch_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_get_point.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_get_point.py new file mode 100644 index 000000000000..15eb50b10cc0 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_get_point.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_point_get_point.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_point( + search_id="ba13fc7947b9b585690d84ee61aaa653", + longitude=-84.386, + latitude=33.676, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesPoint_GetPoint.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_with_assets_get_point_assets.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_with_assets_get_point_assets.py new file mode 100644 index 000000000000..a964f4869d62 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_point_with_assets_get_point_assets.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_point_with_assets_get_point_assets.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_point_with_assets( + search_id="ba13fc7947b9b585690d84ee61aaa653", + longitude=-122.4194, + latitude=37.7749, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesPointWithAssets_GetPointAssets.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_json_get.py new file mode 100644 index 000000000000..655220327b67 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_json_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_json( + search_id="ba13fc7947b9b585690d84ee61aaa653", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_format_get_zxy_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_format_get_zxy_by_format.py new file mode 100644 index 000000000000..0b5ff49c2a73 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_format_get_zxy_by_format.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_matrix_sets_format_get_zxy_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_by_format( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileMatrixSetsFormat_GetZxyByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_get_zxy_scale_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_get_zxy_scale_by_format.py new file mode 100644 index 000000000000..41bb85ef34f5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_get_zxy_scale_by_format.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_matrix_sets_get_zxy_scale_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_by_scale_and_format( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + scale=1, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileMatrixSets_GetZxyScaleByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_plain_get_zxy.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_plain_get_zxy.py new file mode 100644 index 000000000000..57d114a10240 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_plain_get_zxy.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_matrix_sets_plain_get_zxy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileMatrixSetsPlain_GetZxy.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_scale_get_zxy_by_scale.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_scale_get_zxy_by_scale.py new file mode 100644 index 000000000000..dba1ae5e18be --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_scale_get_zxy_by_scale.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_matrix_sets_scale_get_zxy_by_scale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_by_scale( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + scale=1, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileMatrixSetsScale_GetZxyByScale.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_tile_json_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_tile_json_get.py new file mode 100644 index 000000000000..920667228bfa --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_matrix_sets_tile_json_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_matrix_sets_tile_json_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_json_tms( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileMatrixSetsTileJson_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_list_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_list_get.py new file mode 100644 index 000000000000..c3534032e643 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_list_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_set_list_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.list_searches_tilesets( + search_id="ba13fc7947b9b585690d84ee61aaa653", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileSetList_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_metadata_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_metadata_get.py new file mode 100644 index 000000000000..0a5c6dd8e2bc --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tile_set_metadata_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tile_set_metadata_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tileset_metadata( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTileSetMetadata_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_format_get_zxy_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_format_get_zxy_by_format.py new file mode 100644 index 000000000000..43dd14ac5975 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_format_get_zxy_by_format.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tiles_format_get_zxy_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_no_tms_by_format( + search_id="ba13fc7947b9b585690d84ee61aaa653", + z=13, + x=2174, + y=3282, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTilesFormat_GetZxyByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_get_zxy_scale_by_format.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_get_zxy_scale_by_format.py new file mode 100644 index 000000000000..dc52e67fbb41 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_get_zxy_scale_by_format.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tiles_get_zxy_scale_by_format.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_no_tms_by_scale_and_format( + search_id="ba13fc7947b9b585690d84ee61aaa653", + z=13, + x=2174, + y=3282, + scale=1, + format="png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTiles_GetZxyScaleByFormat.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_plain_get_zxy.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_plain_get_zxy.py new file mode 100644 index 000000000000..a3563b4ea336 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_plain_get_zxy.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tiles_plain_get_zxy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_no_tms( + search_id="ba13fc7947b9b585690d84ee61aaa653", + z=13, + x=2174, + y=3282, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTilesPlain_GetZxy.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_scale_get_zxy_by_scale.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_scale_get_zxy_by_scale.py new file mode 100644 index 000000000000..b4e804abee51 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_tiles_scale_get_zxy_by_scale.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_tiles_scale_get_zxy_by_scale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_tile_no_tms_by_scale( + search_id="ba13fc7947b9b585690d84ee61aaa653", + z=13, + x=2174, + y=3282, + scale=1, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesTilesScale_GetZxyByScale.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_get_capabilities_xml.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_get_capabilities_xml.py new file mode 100644 index 000000000000..405cc486913b --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_get_capabilities_xml.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_wmts_get_capabilities_xml.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_wmts_capabilities( + search_id="ba13fc7947b9b585690d84ee61aaa653", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesWmts_GetCapabilitiesXml.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_tile_matrix_sets_get_capabilities_xml.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_tile_matrix_sets_get_capabilities_xml.py new file mode 100644 index 000000000000..be7057de3913 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaic_searches_wmts_tile_matrix_sets_get_capabilities_xml.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaic_searches_wmts_tile_matrix_sets_get_capabilities_xml.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_searches_wmts_capabilities_tms( + search_id="ba13fc7947b9b585690d84ee61aaa653", + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicSearchesWmtsTileMatrixSets_GetCapabilitiesXml.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaics_register_search_register.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaics_register_search_register.py new file mode 100644 index 000000000000..0f669d6ecc66 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/mosaics_register_search_register.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python mosaics_register_search_register.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.register_mosaics_search( + body={ + "filter": { + "args": [ + {"args": [{"property": "collection"}, "naip-atl"], "op": "="}, + {"args": [{"property": "datetime"}, "2021-01-01T00:00:00Z"], "op": ">="}, + {"args": [{"property": "datetime"}, "2022-12-31T23:59:59Z"], "op": "<="}, + ], + "op": "and", + }, + "filter-lang": "cql2-json", + "sortby": [{"direction": "desc", "field": "datetime"}], + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/MosaicsRegisterSearch_Register.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_sign.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_sign.py new file mode 100644 index 000000000000..724ef72b664b --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_sign.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python sas_get_sign.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.sas.get_sign( + href="https://SANITIZED.blob.core.windows.net/naip-atl-00000000/collection-assets/thumbnail/thumbnail.png", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/Sas_GetSign.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_token.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_token.py new file mode 100644 index 000000000000..11cb04cd7a10 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_get_token.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python sas_get_token.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.sas.get_token( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/Sas_GetToken.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_revoke_token.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_revoke_token.py new file mode 100644 index 000000000000..3e2078b4025c --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/sas_revoke_token.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python sas_revoke_token.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.sas.revoke_token() + + +# x-ms-original-file: 2026-04-15/Sas_RevokeToken.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_create.py new file mode 100644 index 000000000000..b86f4807c725 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_create.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_assets_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.create_collection_asset( + collection_id="naip-atl", + body={ + "data": {"description": "str", "key": "str", "roles": ["str"], "title": "str", "type": "str"}, + "file": filetype, + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionAssets_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_delete.py new file mode 100644 index 000000000000..2b8275e073d6 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_assets_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.delete_collection_asset( + collection_id="naip-atl", + asset_id="test-asset", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionAssets_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_replace.py new file mode 100644 index 000000000000..dba7cbfd0796 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_assets_replace.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_assets_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_collection_asset( + collection_id="naip-atl", + asset_id="test-asset", + body={ + "data": {"description": "str", "key": "str", "roles": ["str"], "title": "str", "type": "str"}, + "file": filetype, + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionAssets_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_config_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_config_get.py new file mode 100644 index 000000000000..bc69af750389 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_config_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_config_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_collection_configuration( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionConfig_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_add.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_add.py new file mode 100644 index 000000000000..e9f1fa2af7eb --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_add.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_mosaics_add.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.add_mosaic( + collection_id="naip-atl", + body={"cql": [], "id": "test-mosaic-1", "name": "Test Most recent available"}, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionMosaics_Add.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_delete.py new file mode 100644 index 000000000000..bd2313ef1081 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_mosaics_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.delete_mosaic( + collection_id="naip-atl", + mosaic_id="test-mosaic-1", + ) + + +# x-ms-original-file: 2026-04-15/StacCollectionMosaics_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get.py new file mode 100644 index 000000000000..fd94468e2f21 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_mosaics_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_mosaic( + collection_id="naip-atl", + mosaic_id="test-mosaic-1", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionMosaics_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get_all.py new file mode 100644 index 000000000000..78ffae9593ac --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_get_all.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_mosaics_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.list_mosaics( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionMosaics_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_replace.py new file mode 100644 index 000000000000..ef8692f7425f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_mosaics_replace.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_mosaics_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_mosaic( + collection_id="naip-atl", + mosaic_id="test-mosaic-1", + body={ + "cql": [], + "description": "Most recent available imagery in this collection - updated", + "id": "test-mosaic-1", + "name": "Test Most recent available", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionMosaics_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_get.py new file mode 100644 index 000000000000..15bdbada19f8 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_partition_types_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_partition_type( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionPartitionTypes_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_replace.py new file mode 100644 index 000000000000..71e7c389caa3 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_partition_types_replace.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_partition_types_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.replace_partition_type( + collection_id="test-partition-type-collection", + body={"scheme": "year"}, + ) + + +# x-ms-original-file: 2026-04-15/StacCollectionPartitionTypes_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_create.py new file mode 100644 index 000000000000..0c7e13ba4eba --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_create.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_render_options_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.create_render_option( + collection_id="naip-atl", + body={ + "id": "test-natural-color", + "minZoom": 6, + "name": "Test Natural color", + "options": "assets=image&asset_bidx=image|1,2,3", + "type": "raster-tile", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionRenderOptions_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_delete.py new file mode 100644 index 000000000000..dd9793dea094 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_render_options_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.delete_render_option( + collection_id="naip-atl", + render_option_id="test-natural-color", + ) + + +# x-ms-original-file: 2026-04-15/StacCollectionRenderOptions_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get.py new file mode 100644 index 000000000000..c0c1481300d5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_render_options_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_render_option( + collection_id="naip-atl", + render_option_id="test-natural-color", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionRenderOptions_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get_all.py new file mode 100644 index 000000000000..b7a5f6bcc2d8 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_get_all.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_render_options_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.list_render_options( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionRenderOptions_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_replace.py new file mode 100644 index 000000000000..6ffad78f5b4f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_render_options_replace.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_render_options_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_render_option( + collection_id="naip-atl", + render_option_id="test-natural-color", + body={ + "description": "RGB from visual assets - updated", + "id": "test-natural-color", + "minZoom": 6, + "name": "Test Natural color updated", + "options": "assets=image&asset_bidx=image|1,2,3", + "type": "raster-tile", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionRenderOptions_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_thumbnails_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_thumbnails_get.py new file mode 100644 index 000000000000..a723cefdc994 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_thumbnails_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_thumbnails_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_collection_thumbnail( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionThumbnails_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_get.py new file mode 100644 index 000000000000..adb5edc7dbf8 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_tile_settings_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_tile_settings( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionTileSettings_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_replace.py new file mode 100644 index 000000000000..68e10a82cf37 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collection_tile_settings_replace.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collection_tile_settings_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_tile_settings( + collection_id="naip-atl", + body={"maxItemsPerTile": 35, "minZoom": 6}, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollectionTileSettings_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create.py new file mode 100644 index 000000000000..7743f59cac3d --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collections_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_create_collection( + body={ + "description": "Temporary collection for partition type testing", + "extent": { + "spatial": {"bbox": [[-180, -90, 180, 90]]}, + "temporal": {"interval": [["2020-01-01T00:00:00Z", "2099-12-31T23:59:59Z"]]}, + }, + "id": "test-partition-type-collection", + "license": "proprietary", + "links": [], + "stac_version": "1.0.0", + "title": "Test Partition Type Collection", + "type": "Collection", + }, + ).result() + + +# x-ms-original-file: 2026-04-15/StacCollections_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create_or_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create_or_replace.py new file mode 100644 index 000000000000..98fcd8b3b204 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_create_or_replace.py @@ -0,0 +1,78 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collections_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_collection( + collection_id="test-collection-lifecycle", + body={ + "description": "Test collection for lifecycle operations - UPDATED", + "extent": { + "spatial": {"bbox": [[-180, -90, 180, 90]]}, + "temporal": {"interval": [["2020-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]]}, + }, + "id": "test-collection-lifecycle", + "license": "proprietary", + "links": [ + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/items", + "rel": "items", + "type": "application/geo+json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/", + "rel": "parent", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/", + "rel": "root", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle", + "rel": "self", + "type": "application/json", + }, + ], + "msft:_created": "2025-10-28T18:47:27.7827791Z", + "msft:_updated": "2025-10-28T18:47:27.7827791Z", + "stac_version": "1.0.0", + "title": "Test Collection Lifecycle", + "type": "Collection", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollections_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_delete.py new file mode 100644 index 000000000000..95262540b8e4 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_delete.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collections_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_delete_collection( + collection_id="test-partition-type-collection", + ).result() + + +# x-ms-original-file: 2026-04-15/StacCollections_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get.py new file mode 100644 index 000000000000..009f6384fb25 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collections_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_collection( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollections_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get_all.py new file mode 100644 index 000000000000..2d4369973321 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_get_all.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collections_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_collections() + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollections_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_replace.py new file mode 100644 index 000000000000..80d5e97eaac3 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_collections_replace.py @@ -0,0 +1,78 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_collections_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_collection( + collection_id="test-collection-lifecycle", + body={ + "description": "Test collection for lifecycle operations - UPDATED", + "extent": { + "spatial": {"bbox": [[-180, -90, 180, 90]]}, + "temporal": {"interval": [["2020-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]]}, + }, + "id": "test-collection-lifecycle", + "license": "proprietary", + "links": [ + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/items", + "rel": "items", + "type": "application/geo+json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/", + "rel": "parent", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/", + "rel": "root", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle", + "rel": "self", + "type": "application/json", + }, + ], + "msft:_created": "2025-10-28T18:47:27.7827791Z", + "msft:_updated": "2025-10-28T18:47:27.7827791Z", + "stac_version": "1.0.0", + "title": "Test Collection Lifecycle", + "type": "Collection", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacCollections_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_conformance_class_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_conformance_class_get.py new file mode 100644 index 000000000000..0f26c4f96f15 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_conformance_class_get.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_conformance_class_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_conformance_class() + print(response) + + +# x-ms-original-file: 2026-04-15/StacConformanceClass_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create.py new file mode 100644 index 000000000000..a66f574682e7 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create.py @@ -0,0 +1,86 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_create_item( + collection_id="naip-atl", + body={ + "assets": { + "image": { + "href": "https://SANITIZED.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", + "roles": ["data"], + "title": "RGBIR COG tile", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + } + }, + "bbox": [-84.44157, 33.621853, -84.370894, 33.690654], + "collection": "naip-atl", + "geometry": { + "coordinates": [ + [ + [-84.372943, 33.621853], + [-84.370894, 33.689211], + [-84.439575, 33.690654], + [-84.44157, 33.623293], + [-84.372943, 33.621853], + ] + ], + "type": "Polygon", + }, + "id": "ga_m_3308421_se_16_060_20211114_test", + "links": [ + { + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip-atl", + "rel": "collection", + "type": "application/json", + } + ], + "properties": { + "datetime": "2021-11-14T16:00:00Z", + "gsd": 0.6, + "naip:state": "ga", + "naip:year": "2021", + "proj:bbox": [737334, 3723324, 743706, 3730800], + "proj:epsg": 26916, + "proj:shape": [12460, 10620], + "proj:transform": [0.6, 0, 737334, 0, -0.6, 3730800, 0, 0, 1], + }, + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], + "stac_version": "1.0.0", + "type": "Feature", + }, + ).result() + + +# x-ms-original-file: 2026-04-15/StacItems_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create_or_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create_or_replace.py new file mode 100644 index 000000000000..12e1194fbc50 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_create_or_replace.py @@ -0,0 +1,89 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_create_or_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_replace_item( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114_replace_test", + body={ + "assets": { + "image": { + "href": "https://SANITIZED.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", + "roles": ["data"], + "title": "RGBIR COG tile", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + } + }, + "bbox": [-84.44157, 33.621853, -84.370894, 33.690654], + "collection": "naip-atl", + "geometry": { + "coordinates": [ + [ + [-84.372943, 33.621853], + [-84.370894, 33.689211], + [-84.439575, 33.690654], + [-84.44157, 33.623293], + [-84.372943, 33.621853], + ] + ], + "type": "Polygon", + }, + "id": "ga_m_3308421_se_16_060_20211114_replace_test", + "links": [ + { + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip-atl", + "rel": "collection", + "type": "application/json", + } + ], + "properties": { + "datetime": "2021-11-14T16:00:00Z", + "gsd": 0.6, + "naip:state": "ga", + "naip:year": "2021", + "platform": "Imagery Updated", + "processing_level": "L2", + "proj:bbox": [737334, 3723324, 743706, 3730800], + "proj:epsg": 26916, + "proj:shape": [12460, 10620], + "proj:transform": [0.6, 0, 737334, 0, -0.6, 3730800, 0, 0, 1], + }, + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], + "stac_version": "1.0.0", + "type": "Feature", + }, + ).result() + + +# x-ms-original-file: 2026-04-15/StacItems_CreateOrReplace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_delete.py new file mode 100644 index 000000000000..e882c17c3261 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_delete_item( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114_delete_test", + ).result() + + +# x-ms-original-file: 2026-04-15/StacItems_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get.py new file mode 100644 index 000000000000..2262d7102357 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_item( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114_test", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacItems_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get_features.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get_features.py new file mode 100644 index 000000000000..45492664be94 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_get_features.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_get_features.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_item_collection( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacItems_GetFeatures.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_replace.py new file mode 100644 index 000000000000..856615cd2652 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_replace.py @@ -0,0 +1,89 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_replace_item( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114_replace_test", + body={ + "assets": { + "image": { + "href": "https://SANITIZED.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", + "roles": ["data"], + "title": "RGBIR COG tile", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + } + }, + "bbox": [-84.44157, 33.621853, -84.370894, 33.690654], + "collection": "naip-atl", + "geometry": { + "coordinates": [ + [ + [-84.372943, 33.621853], + [-84.370894, 33.689211], + [-84.439575, 33.690654], + [-84.44157, 33.623293], + [-84.372943, 33.621853], + ] + ], + "type": "Polygon", + }, + "id": "ga_m_3308421_se_16_060_20211114_replace_test", + "links": [ + { + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip-atl", + "rel": "collection", + "type": "application/json", + } + ], + "properties": { + "datetime": "2021-11-14T16:00:00Z", + "gsd": 0.6, + "naip:state": "ga", + "naip:year": "2021", + "platform": "Imagery Updated", + "processing_level": "L2", + "proj:bbox": [737334, 3723324, 743706, 3730800], + "proj:epsg": 26916, + "proj:shape": [12460, 10620], + "proj:transform": [0.6, 0, 737334, 0, -0.6, 3730800, 0, 0, 1], + }, + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], + "stac_version": "1.0.0", + "type": "Feature", + }, + ).result() + + +# x-ms-original-file: 2026-04-15/StacItems_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_update.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_update.py new file mode 100644 index 000000000000..8a8288fb7124 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_items_update.py @@ -0,0 +1,105 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_items_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.begin_update_item( + collection_id="naip-atl", + item_id="ga_m_3308421_se_16_060_20211114_test", + body={ + "_msft:etag": "73fab31c-2e93-422b-b30a-7d259590992f", + "_msft:ts": "2025-10-28T17:52:49.659975Z", + "assets": { + "image": { + "href": "https://SANITIZED.blob.core.windows.net/naip-atl-bde3e846/08a/ga_m_3308421_se_16_060_20211114_test/image.tif", + "roles": ["data"], + "title": "RGBIR COG tile", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + } + }, + "bbox": [-84.44157, 33.621853, -84.370894, 33.690654], + "collection": "naip-atl", + "geometry": { + "coordinates": [ + [ + [-84.372943, 33.621853], + [-84.370894, 33.689211], + [-84.439575, 33.690654], + [-84.44157, 33.623293], + [-84.372943, 33.621853], + ] + ], + "type": "Polygon", + }, + "id": "ga_m_3308421_se_16_060_20211114_test", + "links": [ + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip-atl", + "rel": "collection", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip-atl", + "rel": "parent", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/", + "rel": "root", + "type": "application/json", + }, + { + "href": "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip-atl/items/ga_m_3308421_se_16_060_20211114_test", + "rel": "self", + "type": "application/geo+json", + }, + ], + "properties": { + "datetime": "2021-11-14T16:00:00Z", + "gsd": 0.6, + "naip:state": "ga", + "naip:year": "2021", + "platform": "Imagery", + "proj:bbox": [737334, 3723324, 743706, 3730800], + "proj:epsg": 26916, + "proj:shape": [12460, 10620], + "proj:transform": [0.6, 0, 737334, 0, -0.6, 3730800, 0, 0, 1], + }, + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.1.0/schema.json"], + "stac_version": "1.0.0", + "type": "Feature", + }, + ).result() + + +# x-ms-original-file: 2026-04-15/StacItems_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_landing_pages_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_landing_pages_get.py new file mode 100644 index 000000000000..ed7c19c13747 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_landing_pages_get.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_landing_pages_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_landing_page() + print(response) + + +# x-ms-original-file: 2026-04-15/StacLandingPages_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_create.py new file mode 100644 index 000000000000..bd44edb1f58f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_create.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_queryables_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.create_queryables( + collection_id="naip-atl", + body=[ + { + "create_index": False, + "data_type": "number", + "definition": {"data_type": "number"}, + "name": "test:property", + } + ], + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacQueryables_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_delete.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_delete.py new file mode 100644 index 000000000000..ea7ea607fde9 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_queryables_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + client.stac.delete_queryable( + collection_id="naip-atl", + queryable_name="test%3Aproperty", + ) + + +# x-ms-original-file: 2026-04-15/StacQueryables_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all.py new file mode 100644 index 000000000000..c82a65f3578f --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_queryables_get_all.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.list_queryables() + print(response) + + +# x-ms-original-file: 2026-04-15/StacQueryables_GetAll.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all_by_collection.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all_by_collection.py new file mode 100644 index 000000000000..636a68b3afc0 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_get_all_by_collection.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_queryables_get_all_by_collection.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.get_collection_queryables( + collection_id="naip-atl", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacQueryables_GetAllByCollection.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_replace.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_replace.py new file mode 100644 index 000000000000..69d165c6c471 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_queryables_replace.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_queryables_replace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.replace_queryable( + collection_id="naip-atl", + queryable_name="test%3Aproperty", + body={ + "create_index": False, + "data_type": "number", + "definition": {"data_type": "number", "description": "Test property - updated"}, + "name": "test:property", + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacQueryables_Replace.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_search_create.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_search_create.py new file mode 100644 index 000000000000..dfd9f9a48e54 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/stac_search_create.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python stac_search_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.stac.search( + body={ + "collections": ["naip-atl"], + "datetime": "2021-01-01T00:00:00Z/2022-12-31T00:00:00Z", + "filter": { + "args": [ + {"property": "geometry"}, + { + "coordinates": [ + [ + [-84.46416308610219, 33.6033686729869], + [-84.38815071170247, 33.6033686729869], + [-84.38815071170247, 33.6713179813099], + [-84.46416308610219, 33.6713179813099], + [-84.46416308610219, 33.6033686729869], + ] + ], + "type": "Polygon", + }, + ], + "op": "s_intersects", + }, + "filter-lang": "cql2-json", + "limit": 50, + "sortby": [{"direction": "desc", "field": "datetime"}], + }, + ) + print(response) + + +# x-ms-original-file: 2026-04-15/StacSearch_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_definitions_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_definitions_get.py new file mode 100644 index 000000000000..d488808cb2eb --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_definitions_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python tile_matrix_definitions_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.get_tile_matrix_definitions( + tile_matrix_set_id="WebMercatorQuad", + ) + print(response) + + +# x-ms-original-file: 2026-04-15/TileMatrixDefinitions_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_list_get.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_list_get.py new file mode 100644 index 000000000000..68554883a412 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_samples/tile_matrix_list_get.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.planetarycomputer import PlanetaryComputerProClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-planetarycomputer +# USAGE + python tile_matrix_list_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = PlanetaryComputerProClient( + endpoint="ENDPOINT", + credential=DefaultAzureCredential(), + ) + + response = client.data.list_tile_matrices() + print(response) + + +# x-ms-original-file: 2026-04-15/TileMatrixList_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/conftest.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/conftest.py new file mode 100644 index 000000000000..7b69612cb0a9 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/conftest.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + planetarycomputerpro_subscription_id = os.environ.get( + "PLANETARYCOMPUTERPRO_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + planetarycomputerpro_tenant_id = os.environ.get( + "PLANETARYCOMPUTERPRO_TENANT_ID", "00000000-0000-0000-0000-000000000000" + ) + planetarycomputerpro_client_id = os.environ.get( + "PLANETARYCOMPUTERPRO_CLIENT_ID", "00000000-0000-0000-0000-000000000000" + ) + planetarycomputerpro_client_secret = os.environ.get( + "PLANETARYCOMPUTERPRO_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=planetarycomputerpro_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=planetarycomputerpro_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=planetarycomputerpro_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=planetarycomputerpro_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations.py new file mode 100644 index 000000000000..1fbb36b25b1b --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations.py @@ -0,0 +1,1204 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerProPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProDataOperations(PlanetaryComputerProClientTestBase): + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_matrix_definitions(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_matrix_definitions( + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_list_tile_matrices(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.list_tile_matrices() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_class_map_legend(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_class_map_legend( + classmap_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_interval_legend(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_interval_legend( + classmap_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_legend(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_legend( + color_map_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_register_mosaics_search(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.register_mosaics_search( + body={ + "bbox": [0.0], + "collections": ["str"], + "datetime": "str", + "filter": {"str": {}}, + "filter-lang": "str", + "ids": ["str"], + "intersects": "geometry", + "metadata": { + "assets": ["str"], + "bounds": "str", + "defaults": {"str": "str"}, + "maxzoom": 0, + "minzoom": 0, + "name": "str", + "type": "str", + }, + "query": {"str": {}}, + "sortby": [{"direction": "str", "field": "str"}], + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_list_tilesets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.list_tilesets( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tileset_metadata(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tileset_metadata( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_by_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_by_format( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_by_scale( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_by_scale_and_format( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_no_tms( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_no_tms_by_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_no_tms_by_format( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_no_tms_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_no_tms_by_scale( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_tile_no_tms_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_tile_no_tms_by_scale_and_format( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_feature_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_feature_geo_json( + collection_id="str", + item_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_feature_geo_json_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_feature_geo_json_format( + collection_id="str", + item_id="str", + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_feature_geo_json_width_by_height(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_feature_geo_json_width_by_height( + collection_id="str", + item_id="str", + width=0, + height=0, + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_bounds(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_bounds( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_info(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_info( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_info_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_info_geo_json( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_list_item_available_assets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.list_item_available_assets( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_asset_statistics(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_asset_statistics( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_list_item_statistics(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.list_item_statistics( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_geo_json_statistics(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_geo_json_statistics( + collection_id="str", + item_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_tile_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_tile_json( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_tile_json_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_tile_json_tms( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_wmts_capabilities(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_wmts_capabilities( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_wmts_capabilities_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_wmts_capabilities_tms( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_point(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_point( + collection_id="str", + item_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_preview(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_preview( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_preview_with_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_preview_with_format( + collection_id="str", + item_id="str", + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_bbox_crop(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_bbox_crop( + collection_id="str", + item_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_item_bbox_crop_with_dimensions(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_item_bbox_crop_with_dimensions( + collection_id="str", + item_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + width=0, + height=0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_list_collection_tilesets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.list_collection_tilesets( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tileset_metadata(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tileset_metadata( + collection_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_by_scale_and_format( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_by_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_by_format( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_by_scale( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_no_tms_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_no_tms_by_scale_and_format( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_no_tms( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_no_tms_by_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_no_tms_by_format( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_no_tms_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_no_tms_by_scale( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_json( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_tile_json_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_tile_json_tms( + collection_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_wmts_capabilities(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_wmts_capabilities( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_wmts_capabilities_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_wmts_capabilities_tms( + collection_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_assets_for_tile(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_assets_for_tile( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_assets_for_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_assets_for_tile_no_tms( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_assets_for_bbox(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_assets_for_bbox( + collection_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_info(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_info( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_bbox_crop(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_bbox_crop( + collection_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_bbox_crop_with_dimensions(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_bbox_crop_with_dimensions( + collection_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + width=0, + height=0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_collection_feature_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_collection_feature_geo_json( + collection_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_collection_feature_geo_json_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_collection_feature_geo_json_format( + collection_id="str", + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_collection_feature_geo_json_width_by_height(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_collection_feature_geo_json_width_by_height( + collection_id="str", + width=0, + height=0, + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_point(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_point( + collection_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_collection_point_assets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_collection_point_assets( + collection_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_list_searches_tilesets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.list_searches_tilesets( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tileset_metadata(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tileset_metadata( + search_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_by_scale_and_format( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_by_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_by_format( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_by_scale( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_assets_for_tile(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_assets_for_tile( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_json_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_json_tms( + search_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_wmts_capabilities_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_wmts_capabilities_tms( + search_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_info(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_info( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_bbox_crop(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_bbox_crop( + search_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_bbox_crop_with_dimensions(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_bbox_crop_with_dimensions( + search_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + width=0, + height=0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_bbox_assets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_bbox_assets( + search_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_searches_feature_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_searches_feature_geo_json( + search_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_searches_feature_geo_json_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_searches_feature_geo_json_format( + search_id="str", + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_crop_searches_feature_geo_json_width_by_height(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.crop_searches_feature_geo_json_width_by_height( + search_id="str", + width=0, + height=0, + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_wmts_capabilities(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_wmts_capabilities( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_json(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_json( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_no_tms( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_no_tms_by_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_no_tms_by_format( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_no_tms_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_no_tms_by_scale( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_tile_no_tms_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_tile_no_tms_by_scale_and_format( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_assets_for_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_assets_for_tile_no_tms( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_point(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_point( + search_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_data_get_searches_point_with_assets(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.data.get_searches_point_with_assets( + search_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations_async.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations_async.py new file mode 100644 index 000000000000..194babc42a23 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_data_operations_async.py @@ -0,0 +1,1205 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import PlanetaryComputerProPreparer +from testpreparer_async import PlanetaryComputerProClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProDataOperationsAsync(PlanetaryComputerProClientTestBaseAsync): + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_matrix_definitions(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_matrix_definitions( + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_list_tile_matrices(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.list_tile_matrices() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_class_map_legend(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_class_map_legend( + classmap_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_interval_legend(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_interval_legend( + classmap_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_legend(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_legend( + color_map_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_register_mosaics_search(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.register_mosaics_search( + body={ + "bbox": [0.0], + "collections": ["str"], + "datetime": "str", + "filter": {"str": {}}, + "filter-lang": "str", + "ids": ["str"], + "intersects": "geometry", + "metadata": { + "assets": ["str"], + "bounds": "str", + "defaults": {"str": "str"}, + "maxzoom": 0, + "minzoom": 0, + "name": "str", + "type": "str", + }, + "query": {"str": {}}, + "sortby": [{"direction": "str", "field": "str"}], + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_list_tilesets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.list_tilesets( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tileset_metadata(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tileset_metadata( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_by_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_by_format( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_by_scale( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_by_scale_and_format( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_no_tms( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_no_tms_by_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_no_tms_by_format( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_no_tms_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_no_tms_by_scale( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_tile_no_tms_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_tile_no_tms_by_scale_and_format( + collection_id="str", + item_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_feature_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_feature_geo_json( + collection_id="str", + item_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_feature_geo_json_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_feature_geo_json_format( + collection_id="str", + item_id="str", + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_feature_geo_json_width_by_height(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_feature_geo_json_width_by_height( + collection_id="str", + item_id="str", + width=0, + height=0, + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_bounds(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_bounds( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_info(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_info( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_info_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_info_geo_json( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_list_item_available_assets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.list_item_available_assets( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_asset_statistics(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_asset_statistics( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_list_item_statistics(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.list_item_statistics( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_geo_json_statistics(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_geo_json_statistics( + collection_id="str", + item_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_tile_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_tile_json( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_tile_json_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_tile_json_tms( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_wmts_capabilities(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_wmts_capabilities( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_wmts_capabilities_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_wmts_capabilities_tms( + collection_id="str", + item_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_point(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_point( + collection_id="str", + item_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_preview(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_preview( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_preview_with_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_preview_with_format( + collection_id="str", + item_id="str", + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_bbox_crop(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_bbox_crop( + collection_id="str", + item_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_item_bbox_crop_with_dimensions(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_item_bbox_crop_with_dimensions( + collection_id="str", + item_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + width=0, + height=0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_list_collection_tilesets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.list_collection_tilesets( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tileset_metadata(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tileset_metadata( + collection_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_by_scale_and_format( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_by_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_by_format( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_by_scale( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_no_tms_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_no_tms_by_scale_and_format( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_no_tms( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_no_tms_by_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_no_tms_by_format( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_no_tms_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_no_tms_by_scale( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_json( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_tile_json_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_tile_json_tms( + collection_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_wmts_capabilities(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_wmts_capabilities( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_wmts_capabilities_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_wmts_capabilities_tms( + collection_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_assets_for_tile(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_assets_for_tile( + collection_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_assets_for_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_assets_for_tile_no_tms( + collection_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_assets_for_bbox(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_assets_for_bbox( + collection_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_info(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_info( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_bbox_crop(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_bbox_crop( + collection_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_bbox_crop_with_dimensions(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_bbox_crop_with_dimensions( + collection_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + width=0, + height=0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_collection_feature_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_collection_feature_geo_json( + collection_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_collection_feature_geo_json_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_collection_feature_geo_json_format( + collection_id="str", + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_collection_feature_geo_json_width_by_height(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_collection_feature_geo_json_width_by_height( + collection_id="str", + width=0, + height=0, + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_point(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_point( + collection_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_collection_point_assets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_collection_point_assets( + collection_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_list_searches_tilesets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.list_searches_tilesets( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tileset_metadata(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tileset_metadata( + search_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_by_scale_and_format( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_by_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_by_format( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_by_scale( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_assets_for_tile(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_assets_for_tile( + search_id="str", + tile_matrix_set_id="str", + z=0.0, + x=0.0, + y=0.0, + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_json_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_json_tms( + search_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_wmts_capabilities_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_wmts_capabilities_tms( + search_id="str", + tile_matrix_set_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_info(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_info( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_bbox_crop(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_bbox_crop( + search_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_bbox_crop_with_dimensions(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_bbox_crop_with_dimensions( + search_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + width=0, + height=0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_bbox_assets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_bbox_assets( + search_id="str", + minx=0.0, + miny=0.0, + maxx=0.0, + maxy=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_searches_feature_geo_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_searches_feature_geo_json( + search_id="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_searches_feature_geo_json_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_searches_feature_geo_json_format( + search_id="str", + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_crop_searches_feature_geo_json_width_by_height(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.crop_searches_feature_geo_json_width_by_height( + search_id="str", + width=0, + height=0, + format="str", + body={"geometry": "geometry", "type": "str", "properties": {"str": {}}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_wmts_capabilities(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_wmts_capabilities( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_json(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_json( + search_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_no_tms( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_no_tms_by_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_no_tms_by_format( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_no_tms_by_scale(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_no_tms_by_scale( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_tile_no_tms_by_scale_and_format(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_tile_no_tms_by_scale_and_format( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + scale=0.0, + format="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_assets_for_tile_no_tms(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_assets_for_tile_no_tms( + search_id="str", + z=0.0, + x=0.0, + y=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_point(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_point( + search_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_data_get_searches_point_with_assets(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.data.get_searches_point_with_assets( + search_id="str", + longitude=0.0, + latitude=0.0, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations.py new file mode 100644 index 000000000000..309c6bd75968 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations.py @@ -0,0 +1,243 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerProPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProIngestionOperations(PlanetaryComputerProClientTestBase): + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_cancel_operation(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.cancel_operation( + operation_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_cancel_all_operations(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.cancel_all_operations() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_get_operation(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.get_operation( + operation_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_list_operations(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_operations() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_create_run(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.create_run( + collection_id="str", + ingestion_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_get_run(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.get_run( + collection_id="str", + ingestion_id="str", + run_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_list_runs(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_runs( + collection_id="str", + ingestion_id="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_create(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.create( + collection_id="str", + body={ + "creationTime": "2020-02-20 00:00:00", + "id": "str", + "importType": "str", + "status": "str", + "displayName": "str", + "keepOriginalAssets": bool, + "skipExistingItems": bool, + "sourceCatalogUrl": "str", + "stacGeoparquetUrl": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_begin_delete(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.begin_delete( + collection_id="str", + ingestion_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_get(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.get( + collection_id="str", + ingestion_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_list(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list( + collection_id="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_update(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.update( + collection_id="str", + ingestion_id="str", + body={ + "creationTime": "2020-02-20 00:00:00", + "id": "str", + "importType": "str", + "status": "str", + "displayName": "str", + "keepOriginalAssets": bool, + "skipExistingItems": bool, + "sourceCatalogUrl": "str", + "stacGeoparquetUrl": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_create_source(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.create_source( + body={ + "connectionInfo": {"containerUrl": "str", "objectId": "str"}, + "id": "str", + "kind": "BlobManagedIdentity", + "created": "2020-02-20 00:00:00", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_replace_source(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.replace_source( + id="str", + body={ + "connectionInfo": {"containerUrl": "str", "objectId": "str"}, + "id": "str", + "kind": "BlobManagedIdentity", + "created": "2020-02-20 00:00:00", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_delete_source(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.delete_source( + id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_get_source(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.get_source( + id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_list_sources(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_sources() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_ingestion_list_managed_identities(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_managed_identities() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations_async.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations_async.py new file mode 100644 index 000000000000..75f1b0fb0613 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_ingestion_operations_async.py @@ -0,0 +1,246 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import PlanetaryComputerProPreparer +from testpreparer_async import PlanetaryComputerProClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProIngestionOperationsAsync(PlanetaryComputerProClientTestBaseAsync): + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_cancel_operation(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.cancel_operation( + operation_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_cancel_all_operations(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.cancel_all_operations() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_get_operation(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.get_operation( + operation_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_list_operations(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_operations() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_create_run(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.create_run( + collection_id="str", + ingestion_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_get_run(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.get_run( + collection_id="str", + ingestion_id="str", + run_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_list_runs(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_runs( + collection_id="str", + ingestion_id="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_create(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.create( + collection_id="str", + body={ + "creationTime": "2020-02-20 00:00:00", + "id": "str", + "importType": "str", + "status": "str", + "displayName": "str", + "keepOriginalAssets": bool, + "skipExistingItems": bool, + "sourceCatalogUrl": "str", + "stacGeoparquetUrl": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_begin_delete(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.ingestion.begin_delete( + collection_id="str", + ingestion_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_get(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.get( + collection_id="str", + ingestion_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_list(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list( + collection_id="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_update(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.update( + collection_id="str", + ingestion_id="str", + body={ + "creationTime": "2020-02-20 00:00:00", + "id": "str", + "importType": "str", + "status": "str", + "displayName": "str", + "keepOriginalAssets": bool, + "skipExistingItems": bool, + "sourceCatalogUrl": "str", + "stacGeoparquetUrl": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_create_source(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.create_source( + body={ + "connectionInfo": {"containerUrl": "str", "objectId": "str"}, + "id": "str", + "kind": "BlobManagedIdentity", + "created": "2020-02-20 00:00:00", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_replace_source(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.replace_source( + id="str", + body={ + "connectionInfo": {"containerUrl": "str", "objectId": "str"}, + "id": "str", + "kind": "BlobManagedIdentity", + "created": "2020-02-20 00:00:00", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_delete_source(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.delete_source( + id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_get_source(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.ingestion.get_source( + id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_list_sources(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_sources() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_ingestion_list_managed_identities(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = client.ingestion.list_managed_identities() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations.py new file mode 100644 index 000000000000..a9cdc0535438 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerProPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProSasOperations(PlanetaryComputerProClientTestBase): + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_sas_get_sign(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.sas.get_sign( + href="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_sas_get_token(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.sas.get_token( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_sas_revoke_token(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.sas.revoke_token() + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations_async.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations_async.py new file mode 100644 index 000000000000..c497f81ab67a --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_sas_operations_async.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import PlanetaryComputerProPreparer +from testpreparer_async import PlanetaryComputerProClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProSasOperationsAsync(PlanetaryComputerProClientTestBaseAsync): + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_sas_get_sign(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.sas.get_sign( + href="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_sas_get_token(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.sas.get_token( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_sas_revoke_token(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.sas.revoke_token() + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations.py new file mode 100644 index 000000000000..e38d58578c56 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerProPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProSharedAccessSignatureOperations(PlanetaryComputerProClientTestBase): + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_shared_access_signature_get_sign(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.shared_access_signature.get_sign( + href="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_shared_access_signature_get_token(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.shared_access_signature.get_token( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_shared_access_signature_revoke_token(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.shared_access_signature.revoke_token() + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations_async.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations_async.py new file mode 100644 index 000000000000..ac7b41c36d62 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_shared_access_signature_operations_async.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import PlanetaryComputerProPreparer +from testpreparer_async import PlanetaryComputerProClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProSharedAccessSignatureOperationsAsync(PlanetaryComputerProClientTestBaseAsync): + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_shared_access_signature_get_sign(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.shared_access_signature.get_sign( + href="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_shared_access_signature_get_token(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.shared_access_signature.get_token( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_shared_access_signature_revoke_token(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.shared_access_signature.revoke_token() + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations.py new file mode 100644 index 000000000000..4880829ed0cb --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations.py @@ -0,0 +1,809 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerProPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProStacOperations(PlanetaryComputerProClientTestBase): + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_create_collection_asset(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.create_collection_asset( + collection_id="str", + body={ + "data": {"description": "str", "key": "str", "roles": ["str"], "title": "str", "type": "str"}, + "file": "filetype", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_collection_asset(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_collection_asset( + collection_id="str", + asset_id="str", + body={ + "data": {"description": "str", "key": "str", "roles": ["str"], "title": "str", "type": "str"}, + "file": "filetype", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_delete_collection_asset(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.delete_collection_asset( + collection_id="str", + asset_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_collection_configuration(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_collection_configuration( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_add_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.add_mosaic( + collection_id="str", + body={"cql": [{"str": {}}], "id": "str", "name": "str", "description": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_mosaic( + collection_id="str", + mosaic_id="str", + body={"cql": [{"str": {}}], "id": "str", "name": "str", "description": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_delete_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.delete_mosaic( + collection_id="str", + mosaic_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_mosaic( + collection_id="str", + mosaic_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_list_mosaics(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.list_mosaics( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_begin_create_collection(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.begin_create_collection( + body={ + "description": "str", + "extent": {"spatial": {"bbox": [[0.0]]}, "temporal": {"interval": [["2020-02-20 00:00:00"]]}}, + "id": "str", + "license": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "item_assets": { + "str": { + "title": "str", + "type": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "href": "str", + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "updated": "2020-02-20 00:00:00", + } + }, + "keywords": ["str"], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "stac_extensions": ["str"], + "stac_version": "str", + "summaries": {"str": {}}, + "title": "str", + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_collection(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_collection( + collection_id="str", + body={ + "description": "str", + "extent": {"spatial": {"bbox": [[0.0]]}, "temporal": {"interval": [["2020-02-20 00:00:00"]]}}, + "id": "str", + "license": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "item_assets": { + "str": { + "title": "str", + "type": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "href": "str", + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "updated": "2020-02-20 00:00:00", + } + }, + "keywords": ["str"], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "stac_extensions": ["str"], + "stac_version": "str", + "summaries": {"str": {}}, + "title": "str", + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_begin_delete_collection(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.begin_delete_collection( + collection_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_collection(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_collection( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_collections(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_collections() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_partition_type(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_partition_type( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_partition_type(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_partition_type( + collection_id="str", + body={"scheme": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_create_render_option(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.create_render_option( + collection_id="str", + body={ + "id": "str", + "name": "str", + "conditions": [{"property": "str", "value": "str"}], + "description": "str", + "legend": {"labels": ["str"], "scaleFactor": 0.0, "trimEnd": 0, "trimStart": 0, "type": "str"}, + "minZoom": 0, + "options": "str", + "type": "str", + "vectorOptions": { + "sourceLayer": "str", + "tilejsonKey": "str", + "fillColor": "str", + "filter": ["str"], + "strokeColor": "str", + "strokeWidth": 0, + }, + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_render_option(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_render_option( + collection_id="str", + render_option_id="str", + body={ + "id": "str", + "name": "str", + "conditions": [{"property": "str", "value": "str"}], + "description": "str", + "legend": {"labels": ["str"], "scaleFactor": 0.0, "trimEnd": 0, "trimStart": 0, "type": "str"}, + "minZoom": 0, + "options": "str", + "type": "str", + "vectorOptions": { + "sourceLayer": "str", + "tilejsonKey": "str", + "fillColor": "str", + "filter": ["str"], + "strokeColor": "str", + "strokeWidth": 0, + }, + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_delete_render_option(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.delete_render_option( + collection_id="str", + render_option_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_render_option(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_render_option( + collection_id="str", + render_option_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_list_render_options(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.list_render_options( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_collection_thumbnail(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_collection_thumbnail( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_tile_settings(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_tile_settings( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_tile_settings(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_tile_settings( + collection_id="str", + body={"maxItemsPerTile": 0, "minZoom": 0, "defaultLocation": {"coordinates": [0.0], "zoom": 0}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_conformance_class(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_conformance_class() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_landing_page(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_landing_page() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_begin_create_item(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.begin_create_item( + collection_id="str", + body={ + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "bbox": [0.0], + "geometry": "geometry", + "id": "str", + "properties": { + "datetime": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "end_datetime": "2020-02-20 00:00:00", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "start_datetime": "2020-02-20 00:00:00", + "title": "str", + "updated": "2020-02-20 00:00:00", + }, + "type": "Feature", + "_msft:etag": "str", + "_msft:ts": "2020-02-20 00:00:00", + "collection": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "stac_extensions": ["str"], + "stac_version": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_begin_replace_item(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.begin_replace_item( + collection_id="str", + item_id="str", + body={ + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "bbox": [0.0], + "geometry": "geometry", + "id": "str", + "properties": { + "datetime": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "end_datetime": "2020-02-20 00:00:00", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "start_datetime": "2020-02-20 00:00:00", + "title": "str", + "updated": "2020-02-20 00:00:00", + }, + "type": "Feature", + "_msft:etag": "str", + "_msft:ts": "2020-02-20 00:00:00", + "collection": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "stac_extensions": ["str"], + "stac_version": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_begin_delete_item(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.begin_delete_item( + collection_id="str", + item_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_item(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_item( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_item_collection(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_item_collection( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_begin_update_item(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.begin_update_item( + collection_id="str", + item_id="str", + body={ + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "bbox": [0.0], + "geometry": "geometry", + "id": "str", + "properties": { + "datetime": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "end_datetime": "2020-02-20 00:00:00", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "start_datetime": "2020-02-20 00:00:00", + "title": "str", + "updated": "2020-02-20 00:00:00", + }, + "type": "Feature", + "_msft:etag": "str", + "_msft:ts": "2020-02-20 00:00:00", + "collection": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "stac_extensions": ["str"], + "stac_version": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_create_queryables(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.create_queryables( + collection_id="str", + body=[{"definition": {"str": {}}, "name": "str", "create_index": bool, "data_type": "str"}], + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_replace_queryable(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.replace_queryable( + collection_id="str", + queryable_name="str", + body={"definition": {"str": {}}, "name": "str", "create_index": bool, "data_type": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_delete_queryable(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.delete_queryable( + collection_id="str", + queryable_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_list_queryables(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.list_queryables() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_get_collection_queryables(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.get_collection_queryables( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy + def test_stac_search(self, planetarycomputerpro_endpoint): + client = self.create_client(endpoint=planetarycomputerpro_endpoint) + response = client.stac.search( + body={ + "bbox": [0.0], + "collections": ["str"], + "conf": {"str": {}}, + "datetime": "str", + "fields": [{"exclude": ["str"], "include": ["str"]}], + "filter": {"str": {}}, + "filter-crs": "str", + "filter-lang": "str", + "ids": ["str"], + "intersects": "geometry", + "limit": 0, + "query": {"str": {}}, + "sortby": [{"direction": "str", "field": "str"}], + "token": "str", + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations_async.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations_async.py new file mode 100644 index 000000000000..c338c4b3f1b7 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/test_planetary_computer_pro_stac_operations_async.py @@ -0,0 +1,822 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import PlanetaryComputerProPreparer +from testpreparer_async import PlanetaryComputerProClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestPlanetaryComputerProStacOperationsAsync(PlanetaryComputerProClientTestBaseAsync): + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_create_collection_asset(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.create_collection_asset( + collection_id="str", + body={ + "data": {"description": "str", "key": "str", "roles": ["str"], "title": "str", "type": "str"}, + "file": "filetype", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_collection_asset(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_collection_asset( + collection_id="str", + asset_id="str", + body={ + "data": {"description": "str", "key": "str", "roles": ["str"], "title": "str", "type": "str"}, + "file": "filetype", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_delete_collection_asset(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.delete_collection_asset( + collection_id="str", + asset_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_collection_configuration(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_collection_configuration( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_add_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.add_mosaic( + collection_id="str", + body={"cql": [{"str": {}}], "id": "str", "name": "str", "description": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_mosaic( + collection_id="str", + mosaic_id="str", + body={"cql": [{"str": {}}], "id": "str", "name": "str", "description": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_delete_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.delete_mosaic( + collection_id="str", + mosaic_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_mosaic(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_mosaic( + collection_id="str", + mosaic_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_list_mosaics(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.list_mosaics( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_begin_create_collection(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.stac.begin_create_collection( + body={ + "description": "str", + "extent": {"spatial": {"bbox": [[0.0]]}, "temporal": {"interval": [["2020-02-20 00:00:00"]]}}, + "id": "str", + "license": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "item_assets": { + "str": { + "title": "str", + "type": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "href": "str", + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "updated": "2020-02-20 00:00:00", + } + }, + "keywords": ["str"], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "stac_extensions": ["str"], + "stac_version": "str", + "summaries": {"str": {}}, + "title": "str", + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_collection(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_collection( + collection_id="str", + body={ + "description": "str", + "extent": {"spatial": {"bbox": [[0.0]]}, "temporal": {"interval": [["2020-02-20 00:00:00"]]}}, + "id": "str", + "license": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "item_assets": { + "str": { + "title": "str", + "type": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "href": "str", + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "updated": "2020-02-20 00:00:00", + } + }, + "keywords": ["str"], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "stac_extensions": ["str"], + "stac_version": "str", + "summaries": {"str": {}}, + "title": "str", + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_begin_delete_collection(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.stac.begin_delete_collection( + collection_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_collection(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_collection( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_collections(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_collections() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_partition_type(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_partition_type( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_partition_type(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_partition_type( + collection_id="str", + body={"scheme": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_create_render_option(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.create_render_option( + collection_id="str", + body={ + "id": "str", + "name": "str", + "conditions": [{"property": "str", "value": "str"}], + "description": "str", + "legend": {"labels": ["str"], "scaleFactor": 0.0, "trimEnd": 0, "trimStart": 0, "type": "str"}, + "minZoom": 0, + "options": "str", + "type": "str", + "vectorOptions": { + "sourceLayer": "str", + "tilejsonKey": "str", + "fillColor": "str", + "filter": ["str"], + "strokeColor": "str", + "strokeWidth": 0, + }, + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_render_option(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_render_option( + collection_id="str", + render_option_id="str", + body={ + "id": "str", + "name": "str", + "conditions": [{"property": "str", "value": "str"}], + "description": "str", + "legend": {"labels": ["str"], "scaleFactor": 0.0, "trimEnd": 0, "trimStart": 0, "type": "str"}, + "minZoom": 0, + "options": "str", + "type": "str", + "vectorOptions": { + "sourceLayer": "str", + "tilejsonKey": "str", + "fillColor": "str", + "filter": ["str"], + "strokeColor": "str", + "strokeWidth": 0, + }, + }, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_delete_render_option(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.delete_render_option( + collection_id="str", + render_option_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_render_option(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_render_option( + collection_id="str", + render_option_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_list_render_options(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.list_render_options( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_collection_thumbnail(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_collection_thumbnail( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_tile_settings(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_tile_settings( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_tile_settings(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_tile_settings( + collection_id="str", + body={"maxItemsPerTile": 0, "minZoom": 0, "defaultLocation": {"coordinates": [0.0], "zoom": 0}}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_conformance_class(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_conformance_class() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_landing_page(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_landing_page() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_begin_create_item(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.stac.begin_create_item( + collection_id="str", + body={ + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "bbox": [0.0], + "geometry": "geometry", + "id": "str", + "properties": { + "datetime": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "end_datetime": "2020-02-20 00:00:00", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "start_datetime": "2020-02-20 00:00:00", + "title": "str", + "updated": "2020-02-20 00:00:00", + }, + "type": "Feature", + "_msft:etag": "str", + "_msft:ts": "2020-02-20 00:00:00", + "collection": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "stac_extensions": ["str"], + "stac_version": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_begin_replace_item(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.stac.begin_replace_item( + collection_id="str", + item_id="str", + body={ + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "bbox": [0.0], + "geometry": "geometry", + "id": "str", + "properties": { + "datetime": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "end_datetime": "2020-02-20 00:00:00", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "start_datetime": "2020-02-20 00:00:00", + "title": "str", + "updated": "2020-02-20 00:00:00", + }, + "type": "Feature", + "_msft:etag": "str", + "_msft:ts": "2020-02-20 00:00:00", + "collection": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "stac_extensions": ["str"], + "stac_version": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_begin_delete_item(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.stac.begin_delete_item( + collection_id="str", + item_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_item(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_item( + collection_id="str", + item_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_item_collection(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_item_collection( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_begin_update_item(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await ( + await client.stac.begin_update_item( + collection_id="str", + item_id="str", + body={ + "assets": { + "str": { + "href": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "roles": ["str"], + "title": "str", + "type": "str", + "updated": "2020-02-20 00:00:00", + } + }, + "bbox": [0.0], + "geometry": "geometry", + "id": "str", + "properties": { + "datetime": "str", + "constellation": "str", + "created": "2020-02-20 00:00:00", + "description": "str", + "end_datetime": "2020-02-20 00:00:00", + "gsd": 0.0, + "instruments": ["str"], + "mission": "str", + "platform": "str", + "providers": [{"name": "str", "description": "str", "roles": ["str"], "url": "str"}], + "start_datetime": "2020-02-20 00:00:00", + "title": "str", + "updated": "2020-02-20 00:00:00", + }, + "type": "Feature", + "_msft:etag": "str", + "_msft:ts": "2020-02-20 00:00:00", + "collection": "str", + "links": [ + { + "href": "str", + "body": {"str": {}}, + "headers": {"str": "str"}, + "hreflang": "str", + "length": 0, + "merge": bool, + "method": "GET", + "rel": "str", + "title": "str", + "type": "str", + } + ], + "msft:_created": "2020-02-20 00:00:00", + "msft:_updated": "2020-02-20 00:00:00", + "msft:short_description": "str", + "stac_extensions": ["str"], + "stac_version": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_create_queryables(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.create_queryables( + collection_id="str", + body=[{"definition": {"str": {}}, "name": "str", "create_index": bool, "data_type": "str"}], + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_replace_queryable(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.replace_queryable( + collection_id="str", + queryable_name="str", + body={"definition": {"str": {}}, "name": "str", "create_index": bool, "data_type": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_delete_queryable(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.delete_queryable( + collection_id="str", + queryable_name="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_list_queryables(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.list_queryables() + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_get_collection_queryables(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.get_collection_queryables( + collection_id="str", + ) + + # please add some check logic here by yourself + # ... + + @PlanetaryComputerProPreparer() + @recorded_by_proxy_async + async def test_stac_search(self, planetarycomputerpro_endpoint): + client = self.create_async_client(endpoint=planetarycomputerpro_endpoint) + response = await client.stac.search( + body={ + "bbox": [0.0], + "collections": ["str"], + "conf": {"str": {}}, + "datetime": "str", + "fields": [{"exclude": ["str"], "include": ["str"]}], + "filter": {"str": {}}, + "filter-crs": "str", + "filter-lang": "str", + "ids": ["str"], + "intersects": "geometry", + "limit": 0, + "query": {"str": {}}, + "sortby": [{"direction": "str", "field": "str"}], + "token": "str", + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer.py new file mode 100644 index 000000000000..c9ea7dd4aac5 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.planetarycomputer import PlanetaryComputerProClient +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools + + +class PlanetaryComputerProClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(PlanetaryComputerProClient) + return self.create_client_from_credential( + PlanetaryComputerProClient, + credential=credential, + endpoint=endpoint, + ) + + +PlanetaryComputerProPreparer = functools.partial( + PowerShellPreparer, + "planetarycomputerpro", + planetarycomputerpro_endpoint="https://fake_planetarycomputerpro_endpoint.com", +) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer_async.py b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer_async.py new file mode 100644 index 000000000000..52bbf3fab937 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/generated_tests/testpreparer_async.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.planetarycomputer.aio import PlanetaryComputerProClient +from devtools_testutils import AzureRecordedTestCase + + +class PlanetaryComputerProClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(PlanetaryComputerProClient, is_async=True) + return self.create_client_from_credential( + PlanetaryComputerProClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml b/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml index 10a1800c3cdc..2ddac642faa9 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml +++ b/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml @@ -34,6 +34,8 @@ dependencies = [ "isodate>=0.6.1", "azure-core>=1.37.0", "typing-extensions>=4.6.0", + "pystac>=1.11.0", + "geojson>=2.0.0", ] dynamic = [ "version", "readme" @@ -58,3 +60,9 @@ exclude = [ [tool.setuptools.package-data] pytyped = ["py.typed"] + +[tool.azure-sdk-build] +is_stable = true + +[tool.azure-sdk-conda] +in_bundle = false diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_00_stac_collection_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_00_stac_collection_async.py index 38fa9538ece3..00f209395fbc 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_00_stac_collection_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_00_stac_collection_async.py @@ -49,9 +49,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -63,16 +61,12 @@ async def create_collection(client: PlanetaryComputerProClient, collection_id): if any(c.id == collection_id for c in get_all_collections_response["collections"]): logging.info(f"Collection '{collection_id}' already exists, deleting it...") - collection_delete_operation = await client.stac.begin_delete_collection( - collection_id, polling=True - ) + collection_delete_operation = await client.stac.begin_delete_collection(collection_id, polling=True) await collection_delete_operation.result() logging.info(f"Deleted collection '{collection_id}'") # Define collection spatial and temporal extents (Georgia state bounds) - spatial_extent = StacExtensionSpatialExtent( - bounding_box=[[-85.605165, 30.357851, -80.839729, 35.000659]] - ) + spatial_extent = StacExtensionSpatialExtent(bounding_box=[[-85.605165, 30.357851, -80.839729, 35.000659]]) temporal_extent = StacCollectionTemporalExtent( interval=[ [ @@ -150,9 +144,7 @@ async def create_collection(client: PlanetaryComputerProClient, collection_id): # Create the collection logging.info(f"Creating collection '{collection_id}'...") - collection_create_operation = await client.stac.begin_create_collection( - body=collection_data, polling=False - ) + collection_create_operation = await client.stac.begin_create_collection(body=collection_data, polling=False) await collection_create_operation.result() logging.info(f"Collection '{collection_id}' created successfully") @@ -177,9 +169,7 @@ async def update_collection(client: PlanetaryComputerProClient, collection_id): # Update the collection logging.info("Updating collection...") - await client.stac.create_or_replace_collection( - collection_id=collection_id, body=collection - ) + await client.stac.replace_collection(collection_id=collection_id, body=collection) # Verify the update updated_collection = await client.stac.get_collection(collection_id=collection_id) @@ -200,9 +190,7 @@ async def manage_partition_type(client: PlanetaryComputerProClient, collection_i logging.info("Collection is not empty, skipping partition type update") else: logging.info("Updating partition type to YEAR scheme...") - await client.stac.replace_partition_type( - collection_id, body=PartitionType(scheme=PartitionTypeScheme.YEAR) - ) + await client.stac.replace_partition_type(collection_id, body=PartitionType(scheme=PartitionTypeScheme.YEAR)) logging.info("Partition type updated successfully") @@ -219,20 +207,12 @@ async def manage_render_options(client: PlanetaryComputerProClient, collection_i ) # Check if render option already exists - stac_collection_mosaics_get_all_response = await client.stac.list_render_options( - collection_id=collection_id - ) + stac_collection_mosaics_get_all_response = await client.stac.list_render_options(collection_id=collection_id) - if any( - ro.id == render_option.id for ro in stac_collection_mosaics_get_all_response - ): + if any(ro.id == render_option.id for ro in stac_collection_mosaics_get_all_response): logging.info("Render option 'natural-color' already exists.") - await client.stac.delete_render_option( - collection_id=collection_id, render_option_id=render_option.id - ) - logging.info( - "Deleted existing render option 'natural-color'. Proceeding to create a new one." - ) + await client.stac.delete_render_option(collection_id=collection_id, render_option_id=render_option.id) + logging.info("Deleted existing render option 'natural-color'. Proceeding to create a new one.") # Create render option without description initially render_option = RenderOption( @@ -244,9 +224,7 @@ async def manage_render_options(client: PlanetaryComputerProClient, collection_i ) logging.info(f"Creating render option '{render_option.id}'...") - await client.stac.create_render_option( - collection_id=collection_id, body=render_option - ) + await client.stac.create_render_option(collection_id=collection_id, body=render_option) # List render options await client.stac.list_render_options(collection_id=collection_id) @@ -277,17 +255,11 @@ async def manage_mosaics(client: PlanetaryComputerProClient, collection_id): ) # Check existing mosaics - stac_collection_mosaics_get_all_response = await client.stac.list_mosaics( - collection_id=collection_id - ) + stac_collection_mosaics_get_all_response = await client.stac.list_mosaics(collection_id=collection_id) if any(m.id == mosaic.id for m in stac_collection_mosaics_get_all_response): - logging.info( - f"Mosaic {mosaic.id} already exists. Deleting it before creating a new one." - ) - await client.stac.delete_mosaic( - collection_id=collection_id, mosaic_id=mosaic.id - ) + logging.info(f"Mosaic {mosaic.id} already exists. Deleting it before creating a new one.") + await client.stac.delete_mosaic(collection_id=collection_id, mosaic_id=mosaic.id) # Create Mosaic stac_collection_mosaics_add_response = await client.stac.add_mosaic( @@ -299,19 +271,15 @@ async def manage_mosaics(client: PlanetaryComputerProClient, collection_id): # Update with description mosaic.description = "Most recent available imagery in this collection" - stac_collection_mosaics_create_or_replace_response = ( - await client.stac.replace_mosaic( - collection_id=collection_id, - mosaic_id=mosaic.id, - body=mosaic, - ) + stac_collection_mosaics_create_or_replace_response = await client.stac.replace_mosaic( + collection_id=collection_id, + mosaic_id=mosaic.id, + body=mosaic, ) logging.info(stac_collection_mosaics_create_or_replace_response) # Get the mosaic - retrieved_mosaic = await client.stac.get_mosaic( - collection_id=collection_id, mosaic_id=mosaic.id - ) + retrieved_mosaic = await client.stac.get_mosaic(collection_id=collection_id, mosaic_id=mosaic.id) logging.info(retrieved_mosaic) @@ -349,9 +317,7 @@ async def get_landing_page(client: "PlanetaryComputerProClient"): async def manage_queryables(client: PlanetaryComputerProClient, collection_id): """Create and manage queryables for a collection.""" - stac_queryables_get_all_response = await client.stac.get_collection_queryables( - collection_id=collection_id - ) + stac_queryables_get_all_response = await client.stac.get_collection_queryables(collection_id=collection_id) queryable = StacQueryable( name="eo:cloud_cover", @@ -362,13 +328,8 @@ async def manage_queryables(client: PlanetaryComputerProClient, collection_id): }, ) - if any( - q == queryable.name - for q in stac_queryables_get_all_response["properties"].keys() - ): - await client.stac.delete_queryable( - collection_id=collection_id, queryable_name=queryable.name - ) + if any(q == queryable.name for q in stac_queryables_get_all_response["properties"].keys()): + await client.stac.delete_queryable(collection_id=collection_id, queryable_name=queryable.name) logging.info(f"Deleted existing '{queryable.name}' queryable.") stac_queryables_create_response = await client.stac.create_queryables( @@ -391,9 +352,7 @@ async def manage_queryables(client: PlanetaryComputerProClient, collection_id): await client.stac.list_queryables() -async def get_collection_configuration( - client: PlanetaryComputerProClient, collection_id -): +async def get_collection_configuration(client: PlanetaryComputerProClient, collection_id): """Get collection configuration.""" result = await client.stac.get_collection_configuration(collection_id=collection_id) logging.info(result) @@ -419,17 +378,13 @@ async def manage_collection_assets(client: PlanetaryComputerProClient, collectio thumbnail_tuple = ("thumbnail.png", thumbnail_bytes) try: - await client.stac.delete_collection_asset( - collection_id=collection_id, asset_id="thumbnail" - ) + await client.stac.delete_collection_asset(collection_id=collection_id, asset_id="thumbnail") logging.info("Deleted existing thumbnail asset.") except Exception: logging.info("No existing thumbnail asset to delete.") # Create Collection Asset - await client.stac.create_collection_asset( - collection_id=collection_id, body={"data": data, "file": thumbnail_tuple} - ) + await client.stac.create_collection_asset(collection_id=collection_id, body={"data": data, "file": thumbnail_tuple}) # Create or replace Collection Asset thumbnail_bytes.seek(0) # Reset BytesIO position @@ -448,9 +403,7 @@ async def manage_collection_assets(client: PlanetaryComputerProClient, collectio ) # Get the thumbnail as bytes - thumbnail_response = await client.stac.get_collection_thumbnail( - collection_id=collection_id - ) + thumbnail_response = await client.stac.get_collection_thumbnail(collection_id=collection_id) # Convert the generator to bytes # Collect the async iterator into a list @@ -472,9 +425,7 @@ async def main(): # Create client credential = DefaultAzureCredential() - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=credential, logging_enable=True - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential, logging_enable=True) logging.info(f"Connected to: {endpoint}") logging.info(f"Collection ID: {collection_id}\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_01_ingestion_management_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_01_ingestion_management_async.py index 8a2a3535fa17..260ab7bf7551 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_01_ingestion_management_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_01_ingestion_management_async.py @@ -53,9 +53,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -84,15 +82,11 @@ async def create_managed_identity_ingestion_sources( logging.info(f"Deleted existing source: {source.id}") # Create connection info with managed identity - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) # Create ingestion source with unique ID source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = await client.ingestion.create_source(body=ingestion_source) logging.info(f"Created managed identity ingestion source: {created_source.id}") @@ -123,9 +117,7 @@ async def create_or_replace_source( "AZURE_INGESTION_SAS_CONTAINER_URI environment variable must be set for create_or_replace_source" ) if not sas_token: - raise ValueError( - "AZURE_INGESTION_SAS_TOKEN environment variable must be set for create_or_replace_source" - ) + raise ValueError("AZURE_INGESTION_SAS_TOKEN environment variable must be set for create_or_replace_source") # Create connection info with SAS token connection_info = SharedAccessSignatureTokenConnection( @@ -133,21 +125,17 @@ async def create_or_replace_source( ) # Create ingestion source - ingestion_source = SharedAccessSignatureTokenIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = SharedAccessSignatureTokenIngestionSource(id=source_id, connection_info=connection_info) # First call - replaces the existing source with original token - logging.info( - f"First call to create_or_replace_source with existing source ID: {source_id}" - ) - first_result = await client.ingestion.replace_source( - id=source_id, body=ingestion_source - ) + logging.info(f"First call to create_or_replace_source with existing source ID: {source_id}") + first_result = await client.ingestion.replace_source(id=source_id, body=ingestion_source) logging.info(f"First call result: {first_result.id}") # Second call - replaces again with modified token (demonstrates update capability) - updated_token = "sp=rl&st=2024-01-01T00:00:00Z&se=2024-12-31T23:59:59Z&sv=2023-01-03&sr=c&sig=UpdatedRandomSignature123456" + updated_token = ( + "sp=rl&st=2024-01-01T00:00:00Z&se=2024-12-31T23:59:59Z&sv=2023-01-03&sr=c&sig=UpdatedRandomSignature123456" + ) updated_connection_info = SharedAccessSignatureTokenConnection( container_uri=sas_container_uri, shared_access_signature_token=updated_token @@ -157,9 +145,7 @@ async def create_or_replace_source( ) logging.info("Second call to create_or_replace_source with updated SAS token") - second_result = await client.ingestion.replace_source( - id=source_id, body=updated_ingestion_source - ) + second_result = await client.ingestion.replace_source(id=source_id, body=updated_ingestion_source) logging.info(f"Second call result: {second_result.id}") return second_result.id @@ -190,9 +176,7 @@ async def create_github_public_ingestion( # Delete all existing ingestions logging.info("Deleting all existing ingestions...") async for ingestion in client.ingestion.list(collection_id=collection_id): - await client.ingestion.begin_delete( - collection_id=collection_id, ingestion_id=ingestion.id, polling=True - ) + await client.ingestion.begin_delete(collection_id=collection_id, ingestion_id=ingestion.id, polling=True) logging.info(f"Deleted existing ingestion: {ingestion.id}") # Create ingestion definition @@ -206,9 +190,7 @@ async def create_github_public_ingestion( # Create the ingestion logging.info("Creating ingestion for sample catalog...") - ingestion_response = await client.ingestion.create( - collection_id=collection_id, body=ingestion_definition - ) + ingestion_response = await client.ingestion.create(collection_id=collection_id, body=ingestion_definition) ingestion_id = ingestion_response.id logging.info(f"Created ingestion: {ingestion_id}") @@ -221,29 +203,21 @@ async def create_github_public_ingestion( ingestion = await client.ingestion.update( collection_id=collection_id, ingestion_id=ingestion_id, body=updated_definition ) - logging.info( - f"Updated ingestion display name to: {updated_definition.display_name}" - ) + logging.info(f"Updated ingestion display name to: {updated_definition.display_name}") return ingestion_id -async def get_ingestion_by_id( - client: PlanetaryComputerProClient, collection_id: str, ingestion_id: str -): +async def get_ingestion_by_id(client: PlanetaryComputerProClient, collection_id: str, ingestion_id: str): """Retrieve a specific ingestion by ID. This demonstrates using get to fetch a specific ingestion directly instead of listing all ingestions. """ - logging.info( - f"Retrieving ingestion: {ingestion_id} from collection: {collection_id}" - ) + logging.info(f"Retrieving ingestion: {ingestion_id} from collection: {collection_id}") try: - ingestion = await client.ingestion.get( - collection_id=collection_id, ingestion_id=ingestion_id - ) + ingestion = await client.ingestion.get(collection_id=collection_id, ingestion_id=ingestion_id) logging.info(f"Successfully retrieved ingestion: {ingestion.id}") logging.info(f" Display name: {ingestion.display_name}") @@ -257,9 +231,7 @@ async def get_ingestion_by_id( return None -async def list_ingestion_runs( - client: PlanetaryComputerProClient, collection_id: str, ingestion_id: str -): +async def list_ingestion_runs(client: PlanetaryComputerProClient, collection_id: str, ingestion_id: str): """List all runs for a specific ingestion. This demonstrates using list_runs to get all execution runs for an ingestion, @@ -268,9 +240,7 @@ async def list_ingestion_runs( logging.info(f"Listing runs for ingestion: {ingestion_id}") try: - async for run in client.ingestion.list_runs( - collection_id=collection_id, ingestion_id=ingestion_id - ): + async for run in client.ingestion.list_runs(collection_id=collection_id, ingestion_id=ingestion_id): operation = run.operation logging.info(f" Run ID: {run.id}") logging.info(f" Status: {operation.status}") @@ -284,16 +254,12 @@ async def list_ingestion_runs( if operation.status_history: for status_item in operation.status_history: if status_item.error_code: - logging.info( - f" Error: {status_item.error_code} - {status_item.error_message}" - ) + logging.info(f" Error: {status_item.error_code} - {status_item.error_message}") except Exception as e: logging.error(f"Failed to list runs for ingestion {ingestion_id}: {str(e)}") -async def create_sas_token_ingestion_source( - client: PlanetaryComputerProClient, sas_container_uri: str, sas_token: str -): +async def create_sas_token_ingestion_source(client: PlanetaryComputerProClient, sas_container_uri: str, sas_token: str): """Create a SAS token ingestion source with example values.""" # Validate required parameters @@ -327,15 +293,11 @@ async def create_sas_token_ingestion_source( return created_sas_source.id -async def create_ingestion_run( - client: PlanetaryComputerProClient, collection_id: str, ingestion_id: str -): +async def create_ingestion_run(client: PlanetaryComputerProClient, collection_id: str, ingestion_id: str): """Create an ingestion run.""" # Create ingestion run - run_response = await client.ingestion.create_run( - collection_id=collection_id, ingestion_id=ingestion_id - ) + run_response = await client.ingestion.create_run(collection_id=collection_id, ingestion_id=ingestion_id) logging.info(f"Created ingestion run: {run_response.id}") return run_response.id @@ -362,6 +324,8 @@ async def manage_operations(client: "PlanetaryComputerProClient"): # Cancel all operations try: + # Cancel all operations across the entire GeoCatalog instance. + # WARNING: This cancels ALL pending/running operations, not just those for a specific collection. await client.ingestion.cancel_all_operations() except HttpResponseError as e: raise RuntimeError("Failed to cancel all operations") from e @@ -375,9 +339,7 @@ async def main(): # Get optional ingestion-specific configuration (for examples) container_uri = os.environ.get("PLANETARYCOMPUTER_INGESTION_CONTAINER_URI") source_catalog_url = os.environ.get("PLANETARYCOMPUTER_INGESTION_CATALOG_URL") - managed_identity_object_id = os.environ.get( - "PLANETARYCOMPUTER_MANAGED_IDENTITY_OBJECT_ID" - ) + managed_identity_object_id = os.environ.get("PLANETARYCOMPUTER_MANAGED_IDENTITY_OBJECT_ID") sas_container_uri = os.environ.get("AZURE_INGESTION_SAS_CONTAINER_URI") sas_token = os.environ.get("AZURE_INGESTION_SAS_TOKEN") @@ -405,23 +367,15 @@ async def main(): # Execute ingestion management workflow # 1. Create managed identity and SAS token ingestion sources - await create_managed_identity_ingestion_sources( - client, container_uri, managed_identity_object_id - ) - sas_source_id = await create_sas_token_ingestion_source( - client, sas_container_uri, sas_token - ) + await create_managed_identity_ingestion_sources(client, container_uri, managed_identity_object_id) + sas_source_id = await create_sas_token_ingestion_source(client, sas_container_uri, sas_token) # 2. Demonstrate advanced source operations (idempotent) - updated_source_id = await create_or_replace_source( - client, sas_container_uri, sas_token, sas_source_id - ) + updated_source_id = await create_or_replace_source(client, sas_container_uri, sas_token, sas_source_id) await get_source_by_id(client, updated_source_id) # 3. Run actual ingestion hosted on GitHub - public_ingestion_id = await create_github_public_ingestion( - client, collection_id, source_catalog_url - ) + public_ingestion_id = await create_github_public_ingestion(client, collection_id, source_catalog_url) # 4. Demonstrate advanced ingestion operations await get_ingestion_by_id(client, collection_id, public_ingestion_id) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_02_stac_specification_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_02_stac_specification_async.py index 808223554c38..cfbe302fc6fe 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_02_stac_specification_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_02_stac_specification_async.py @@ -48,9 +48,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -69,11 +67,7 @@ async def search_collections(client: "PlanetaryComputerProClient"): # Show first few collections for collection in collections.collections[:3]: if collection.description: - desc = ( - collection.description[:100] + "..." - if len(collection.description) > 100 - else collection.description - ) + desc = collection.description[:100] + "..." if len(collection.description) > 100 else collection.description logging.info(f" - {collection.id}: {desc}") @@ -103,11 +97,7 @@ async def search_items(client: PlanetaryComputerProClient, collection_id): ], }, date_time="2021-01-01T00:00:00Z/2022-12-31T00:00:00Z", - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.DESC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.DESC)], limit=50, ) @@ -232,16 +222,12 @@ def get_sample_stac_item(collection_id: str, item_id: str) -> StacItem: async def create_stac_item(client: PlanetaryComputerProClient, collection_id, item_id): """Create a STAC item.""" stac_item = get_sample_stac_item(collection_id, item_id) - stac_item_get_items_response = await client.stac.get_item_collection( - collection_id=collection_id - ) + stac_item_get_items_response = await client.stac.get_item_collection(collection_id=collection_id) for item in stac_item_get_items_response.features: logging.error(item.id) if any(item.id == stac_item.id for item in stac_item_get_items_response.features): - logging.info( - f"Item {stac_item.id} already exists. Deleting it before creating a new one." - ) + logging.info(f"Item {stac_item.id} already exists. Deleting it before creating a new one.") delete_poller = await client.stac.begin_delete_item( collection_id=collection_id, item_id=stac_item.id, polling=True ) @@ -273,56 +259,44 @@ async def update_stac_item(client: PlanetaryComputerProClient, collection_id, it ) await stac_item_create_or_update_response.result() - logging.info( - f"Updated item {stac_item.id}, platform: {stac_item.properties['platform']}" - ) + logging.info(f"Updated item {stac_item.id}, platform: {stac_item.properties['platform']}") -async def create_or_replace_stac_item( - client: PlanetaryComputerProClient, collection_id, item_id -): +async def create_or_replace_stac_item(client: PlanetaryComputerProClient, collection_id, item_id): """Create or replace a STAC item (idempotent operation). - This demonstrates using begin_create_or_replace_item which is idempotent: + This demonstrates using begin_replace_item: - First ensures item exists by creating it with begin_create_item - - Then demonstrates replace using begin_create_or_replace_item + - Then demonstrates replace using begin_replace_item - Multiple calls with the same data produce the same result """ # First, create the item using begin_create_item stac_item = get_sample_stac_item(collection_id, item_id) try: - create_poller = await client.stac.begin_create_item( - collection_id=collection_id, body=stac_item, polling=True - ) + create_poller = await client.stac.begin_create_item(collection_id=collection_id, body=stac_item, polling=True) await create_poller.result() logging.info(f"Created item {item_id}") except ResourceExistsError: logging.info(f"Item {item_id} already exists, continuing...") # Verify creation - created_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + created_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) logging.info(f"Verified item {created_item.id}") # Now demonstrate create_or_replace (replace since item exists) stac_item.properties["platform"] = "Imagery Updated" stac_item.properties["processing_level"] = "L2" - replace_poller = await client.stac.begin_create_or_replace_item( + replace_poller = await client.stac.begin_replace_item( collection_id=collection_id, item_id=item_id, body=stac_item, polling=True ) await replace_poller.result() logging.info(f"Replaced item {item_id} using create_or_replace") # Verify replacement - replaced_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) - logging.info( - f"Verified replaced item, platform: {replaced_item.properties.get('platform', 'N/A')}" - ) + replaced_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) + logging.info(f"Verified replaced item, platform: {replaced_item.properties.get('platform', 'N/A')}") async def delete_stac_item(client: PlanetaryComputerProClient, collection_id, item_id): @@ -333,24 +307,18 @@ async def delete_stac_item(client: PlanetaryComputerProClient, collection_id, it """ try: # Check if item exists before attempting deletion - existing_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + existing_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) logging.info(f"Found item {existing_item.id} to delete") # Delete the item using begin_delete_item - delete_poller = await client.stac.begin_delete_item( - collection_id=collection_id, item_id=item_id, polling=True - ) + delete_poller = await client.stac.begin_delete_item(collection_id=collection_id, item_id=item_id, polling=True) await delete_poller.result() logging.info(f"Successfully deleted item {item_id}") # Verify deletion by attempting to retrieve the item try: await client.stac.get_item(collection_id=collection_id, item_id=item_id) - logging.warning( - f"Item {item_id} still exists after deletion (may take time to propagate)" - ) + logging.warning(f"Item {item_id} still exists after deletion (may take time to propagate)") except ResourceNotFoundError: logging.info(f"Verified item {item_id} was successfully deleted") @@ -386,11 +354,7 @@ async def query_items(client: PlanetaryComputerProClient, collection_id): # Sorted query sorted_options = StacSearchParameters( collections=[collection_id], - sort_by=[ - StacSortExtension( - field="eo:cloud_cover", direction=StacSearchSortingDirection.ASC - ) - ], + sort_by=[StacSortExtension(field="eo:cloud_cover", direction=StacSearchSortingDirection.ASC)], limit=3, ) @@ -404,16 +368,12 @@ async def query_items(client: PlanetaryComputerProClient, collection_id): async def get_queryables(client: PlanetaryComputerProClient, collection_id): """Get queryable properties for a collection.""" - queryables = await client.stac.get_collection_queryables( - collection_id=collection_id - ) + queryables = await client.stac.get_collection_queryables(collection_id=collection_id) properties = queryables.get("properties") if properties: for prop_name in list(properties.keys())[:10]: # Show first 10 - logging.info( - f" - {prop_name}: {properties[prop_name].get('description', '')}" - ) + logging.info(f" - {prop_name}: {properties[prop_name].get('description', '')}") async def main(): @@ -427,9 +387,7 @@ async def main(): # Create client credential = DefaultAzureCredential() - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=credential, logging_enable=False - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential, logging_enable=False) # Execute STAC specification operations await get_landing_page(client) @@ -442,9 +400,7 @@ async def main(): await create_stac_item(client, collection_id, item_id) await update_stac_item(client, collection_id, item_id) await create_or_replace_stac_item(client, collection_id, f"{item_id}_replace_demo") - await delete_stac_item( - client, collection_id, f"{item_id}_replace_demo" - ) # Clean up the item created above + await delete_stac_item(client, collection_id, f"{item_id}_replace_demo") # Clean up the item created above await get_collection(client, collection_id) await client.close() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_03_shared_access_signature_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_03_shared_access_signature_async.py index 84d2a5b64bc6..29ca1fad1292 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_03_shared_access_signature_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_03_shared_access_signature_async.py @@ -30,17 +30,13 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) async def generate_sas_token(client: PlanetaryComputerProClient, collection_id: str): """Generate a SAS token for a collection.""" - get_token_response = await client.shared_access_signature.get_token( - collection_id=collection_id, duration_in_minutes=60 - ) + get_token_response = await client.sas.get_token(collection_id=collection_id, duration_in_minutes=60) return get_token_response @@ -59,9 +55,7 @@ async def sign_asset_href(client: PlanetaryComputerProClient, collection_id: str else: raise Exception("No thumbnail found in collection assets.") - get_sign_response = await client.shared_access_signature.get_sign( - href=href, duration_in_minutes=60 - ) + get_sign_response = await client.sas.get_sign(href=href, duration_in_minutes=60) return get_sign_response.href, href # Return both signed and unsigned hrefs @@ -82,14 +76,12 @@ async def download_asset(signed_href: str): # Check that it's a PNG by verifying the PNG magic bytes (89 50 4E 47) is_png = content[:8] == b"\x89PNG\r\n\x1a\n" if not is_png: - raise Exception( - f"Downloaded content is not a valid PNG file (magic bytes: {content[:8].hex()})" - ) + raise Exception(f"Downloaded content is not a valid PNG file (magic bytes: {content[:8].hex()})") async def revoke_token(client: "PlanetaryComputerProClient") -> None: """Revoke the current SAS token.""" - await client.shared_access_signature.revoke_token() + await client.sas.revoke_token() async def main(): diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py index 6b1267aecb4a..aaa411439bdc 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py @@ -32,9 +32,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -52,9 +50,7 @@ async def display_response(response, filename): async def get_tile_matrix_definitions(client: "PlanetaryComputerProClient"): """Get tile matrix definitions for WebMercatorQuad.""" - result = await client.data.get_tile_matrix_definitions( - tile_matrix_set_id="WebMercatorQuad" - ) + result = await client.data.get_tile_matrix_definitions(tile_matrix_set_id="WebMercatorQuad") logging.info(result) @@ -64,29 +60,19 @@ async def list_tile_matrices(client: "PlanetaryComputerProClient"): logging.info(result) -async def get_asset_statistics( - client: PlanetaryComputerProClient, collection_id, item_id -): +async def get_asset_statistics(client: PlanetaryComputerProClient, collection_id, item_id): """Get asset statistics for an item.""" - result = await client.data.get_asset_statistics( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result = await client.data.get_item_asset_statistics(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info(result) -async def list_available_assets( - client: PlanetaryComputerProClient, collection_id, item_id -): +async def list_available_assets(client: PlanetaryComputerProClient, collection_id, item_id): """List available assets for an item.""" - result = client.data.list_available_assets( - collection_id=collection_id, item_id=item_id - ) + result = client.data.list_item_available_assets(collection_id=collection_id, item_id=item_id) logging.info(result) -async def get_item_asset_details( - client: PlanetaryComputerProClient, collection_id, item_id -): +async def get_item_asset_details(client: PlanetaryComputerProClient, collection_id, item_id): """Get basic info for dataset's assets. Returns dataset's basic information including data types, bounds, and other metadata @@ -94,7 +80,7 @@ async def get_item_asset_details( """ # Get info for specific assets - result_specific = await client.data.get_item_asset_details( + result_specific = await client.data.get_item_info( collection_id=collection_id, item_id=item_id, assets=["image"] ) logging.info("Assets info (image asset only):") @@ -103,52 +89,42 @@ async def get_item_asset_details( async def get_bounds(client: PlanetaryComputerProClient, collection_id, item_id): """List bounds for an item.""" - result = await client.data.get_bounds(collection_id=collection_id, item_id=item_id) + result = await client.data.get_item_bounds(collection_id=collection_id, item_id=item_id) logging.info(result) -async def crop_geo_json( - client: PlanetaryComputerProClient, collection_id, item_id, geojson -): +async def crop_geo_json(client: PlanetaryComputerProClient, collection_id, item_id, geojson): """Crop an item using GeoJSON geometry.""" - crop_geo_json_response = await client.data.crop_geo_json( + crop_geo_json_response = await client.data.crop_feature_geo_json( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], body=geojson, ) logging.info("Cropping with GeoJSON completed") await display_response(crop_geo_json_response, f"crop_geojson_{item_id}.png") -async def crop_geo_json_with_dimensions( - client: PlanetaryComputerProClient, collection_id, item_id, geojson -): +async def crop_geo_json_with_dimensions(client: PlanetaryComputerProClient, collection_id, item_id, geojson): """Crop an item using GeoJSON geometry with specific dimensions.""" - crop_geo_json_with_dimensions_response = ( - await client.data.crop_geo_json_with_dimensions( - collection_id=collection_id, - item_id=item_id, - format=TilerImageFormat.PNG, - width=512, - height=512, - assets=["image"], - asset_band_indices="image|1,2,3", - body=geojson, - ) - ) - await display_response( - crop_geo_json_with_dimensions_response, f"crop_geojson_dims_{item_id}.png" + crop_geo_json_with_dimensions_response = await client.data.crop_feature_geo_json_width_by_height( + collection_id=collection_id, + item_id=item_id, + format=TilerImageFormat.PNG, + width=512, + height=512, + assets=["image"], + asset_band_indices=["image|1,2,3"], + body=geojson, ) + await display_response(crop_geo_json_with_dimensions_response, f"crop_geojson_dims_{item_id}.png") -async def get_geo_json_statistics( - client: PlanetaryComputerProClient, collection_id, item_id, geojson -): +async def get_geo_json_statistics(client: PlanetaryComputerProClient, collection_id, item_id, geojson): """Get statistics for a GeoJSON area.""" - result = await client.data.get_geo_json_statistics( + result = await client.data.get_item_geo_json_statistics( collection_id=collection_id, item_id=item_id, body=geojson, assets=["image"] ) logging.info(result) @@ -156,15 +132,13 @@ async def get_geo_json_statistics( async def get_info_geo_json(client: PlanetaryComputerProClient, collection_id, item_id): """Get info for GeoJSON.""" - result = await client.data.get_info_geo_json( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result = await client.data.get_item_info_geo_json(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info(result) async def get_part(client: PlanetaryComputerProClient, collection_id, item_id, bounds): """Get a part of an item with specific bounds.""" - get_part_response = await client.data.get_part( + get_part_response = await client.data.get_item_bbox_crop( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, @@ -175,16 +149,14 @@ async def get_part(client: PlanetaryComputerProClient, collection_id, item_id, b width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) await display_response(get_part_response, f"part_{item_id}.png") -async def get_part_with_dimensions( - client: PlanetaryComputerProClient, collection_id, item_id, bounds -): +async def get_part_with_dimensions(client: PlanetaryComputerProClient, collection_id, item_id, bounds): """Get a part of an item with specific bounds and dimensions.""" - get_part_with_dimensions_response = await client.data.get_part_with_dimensions( + get_part_with_dimensions_response = await client.data.get_item_bbox_crop_with_dimensions( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, @@ -195,69 +167,61 @@ async def get_part_with_dimensions( width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", - ) - await display_response( - get_part_with_dimensions_response, f"part_dims_{item_id}.png" + asset_band_indices=["image|1,2,3"], ) + await display_response(get_part_with_dimensions_response, f"part_dims_{item_id}.png") async def get_point(client: PlanetaryComputerProClient, collection_id, item_id, point): """Get point value at a specific location.""" - result = await client.data.get_point( + result = await client.data.get_item_point( collection_id=collection_id, item_id=item_id, assets=["image"], longitude=point[0], latitude=point[1], - no_data=0, + no_data="0", ) logging.info(f"Point values at ({point[0]}, {point[1]}): {result}") async def get_preview(client: PlanetaryComputerProClient, collection_id, item_id): """Get a preview of an item.""" - get_preview_response = await client.data.get_preview( + get_preview_response = await client.data.get_item_preview( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) await display_response(get_preview_response, f"preview_{item_id}.png") -async def get_preview_with_format( - client: PlanetaryComputerProClient, collection_id, item_id -): +async def get_preview_with_format(client: PlanetaryComputerProClient, collection_id, item_id): """Get a preview of an item with specific format.""" - get_preview_with_format_response = await client.data.get_preview_with_format( + get_preview_with_format_response = await client.data.get_item_preview_with_format( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", - ) - await display_response( - get_preview_with_format_response, f"preview_format_{item_id}.png" + asset_band_indices=["image|1,2,3"], ) + await display_response(get_preview_with_format_response, f"preview_format_{item_id}.png") async def list_statistics(client: PlanetaryComputerProClient, collection_id, item_id): """List statistics for an item.""" - result = client.data.list_statistics( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result = client.data.list_item_statistics(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info(result) async def get_tile_json(client: PlanetaryComputerProClient, collection_id, item_id): """Get TileJSON for an item.""" - result = await client.data.get_tile_json( + result = await client.data.get_item_tile_json( collection_id=collection_id, item_id=item_id, tile_matrix_set_id="WebMercatorQuad", @@ -266,7 +230,7 @@ async def get_tile_json(client: PlanetaryComputerProClient, collection_id, item_ min_zoom=7, max_zoom=14, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) logging.info(result) @@ -283,18 +247,14 @@ async def get_tile(client: PlanetaryComputerProClient, collection_id, item_id): scale=1, format="png", assets=["image"], - asset_band_indices="image|1,2,3", - ) - await display_response( - get_tile_with_matrix_set_response, f"tile_{item_id}_z14_x4349_y6564.png" + asset_band_indices=["image|1,2,3"], ) + await display_response(get_tile_with_matrix_set_response, f"tile_{item_id}_z14_x4349_y6564.png") -async def get_wmts_capabilities( - client: PlanetaryComputerProClient, collection_id, item_id -): +async def get_wmts_capabilities(client: PlanetaryComputerProClient, collection_id, item_id): """Get WMTS capabilities and save it locally.""" - get_wmts_capabilities_response = await client.data.get_wmts_capabilities( + get_wmts_capabilities_response = await client.data.get_item_wmts_capabilities( collection_id=collection_id, item_id=item_id, tile_matrix_set_id="WebMercatorQuad", @@ -303,7 +263,7 @@ async def get_wmts_capabilities( min_zoom=7, max_zoom=14, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) # Collect the async iterator into a list xml_bytes_chunks = [] diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py index 2cc4d7916119..f5f8d9cfe411 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py @@ -27,15 +27,13 @@ StacSortExtension, StacSearchSortingDirection, TilerImageFormat, - ImageParameters, - Polygon, + + ) import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -57,50 +55,38 @@ async def register_mosaics_search(client: PlanetaryComputerProClient, collection ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_search_response = await client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_search_response = await client.data.register_mosaics_search(register_search_request) logging.info(register_search_response) return register_search_response async def get_mosaics_search_info(client: PlanetaryComputerProClient, search_id): """Get mosaics search info.""" - mosaics_info_search_response = await client.data.get_mosaics_search_info( - search_id=search_id - ) + mosaics_info_search_response = await client.data.get_searches_info(search_id=search_id) search = mosaics_info_search_response.search return search -async def get_mosaics_tile_json( - client: PlanetaryComputerProClient, search_id, collection_id -): +async def get_mosaics_tile_json(client: PlanetaryComputerProClient, search_id, collection_id): """Get mosaics tile JSON.""" - get_mosaics_tile_json_response = await client.data.get_mosaics_tile_json( + get_mosaics_tile_json_response = await client.data.get_searches_tile_json( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], tile_scale=1, min_zoom=9, - collection=collection_id, + collection_id=collection_id, tile_format="png", ) logging.info(get_mosaics_tile_json_response.as_dict()) -async def get_mosaics_tile( - client: PlanetaryComputerProClient, search_id, collection_id -): +async def get_mosaics_tile(client: PlanetaryComputerProClient, search_id, collection_id): """Get a mosaic tile and save it locally.""" - mosaics_tile_matrix_sets_response = await client.data.get_mosaics_tile( + mosaics_tile_matrix_sets_response = await client.data.get_searches_tile_by_scale_and_format( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -109,7 +95,7 @@ async def get_mosaics_tile( scale=1, format="png", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], collection=collection_id, ) # Collect the async iterator into a list @@ -122,14 +108,12 @@ async def get_mosaics_tile( filename = f"mosaic_tile_{search_id}_z13_x2174_y3282.png" with open(filename, "wb") as f: f.write(mosaics_tile_matrix_sets_bytes) - logging.info( - f"Tile saved as: {filename} ({len(mosaics_tile_matrix_sets_bytes)} bytes)" - ) + logging.info(f"Tile saved as: {filename} ({len(mosaics_tile_matrix_sets_bytes)} bytes)") async def get_mosaics_wmts_capabilities(client: PlanetaryComputerProClient, search_id): """Get WMTS capabilities for mosaics and save it locally.""" - get_capabilities_xml_response = await client.data.get_mosaics_wmts_capabilities( + get_capabilities_xml_response = await client.data.get_searches_wmts_capabilities( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", tile_format=TilerImageFormat.PNG, @@ -137,7 +121,7 @@ async def get_mosaics_wmts_capabilities(client: PlanetaryComputerProClient, sear min_zoom=7, max_zoom=13, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) # Collect the async iterator into a list xml_bytes_chunks = [] @@ -156,7 +140,7 @@ async def get_mosaics_wmts_capabilities(client: PlanetaryComputerProClient, sear async def get_mosaics_assets_for_point(client: PlanetaryComputerProClient, search_id): """Get mosaic assets for a specific point (center of the bbox).""" # Using center point from the coordinate bbox: -84.43202751899601, 33.639647639722273 - get_lon_lat_assets_response = await client.data.get_mosaics_assets_for_point( + get_lon_lat_assets_response = await client.data.get_searches_point_with_assets( search_id=search_id, longitude=-84.43202751899601, latitude=33.639647639722273, @@ -170,11 +154,9 @@ async def get_mosaics_assets_for_point(client: PlanetaryComputerProClient, searc logging.info(f"Assets for point: {get_lon_lat_assets_response[0]['id']}") -async def get_mosaics_assets_for_tile( - client: PlanetaryComputerProClient, search_id, collection_id -): +async def get_mosaics_assets_for_tile(client: PlanetaryComputerProClient, search_id, collection_id): """Get mosaic assets for a specific tile.""" - result = await client.data.get_mosaics_assets_for_tile( + result = await client.data.get_searches_assets_for_tile( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -185,91 +167,6 @@ async def get_mosaics_assets_for_tile( logging.info(f"Assets for tile: {result}") -async def create_static_image(client: PlanetaryComputerProClient, collection_id): - """Create a static image from a STAC item. - - This demonstrates creating a static image tile with specific rendering parameters. - The image is created asynchronously and can be retrieved using the returned image ID. - """ - # Define CQL filter with date range - cql_filter = { - "op": "and", - "args": [ - {"op": "=", "args": [{"property": "collection"}, collection_id]}, - { - "op": "anyinteracts", - "args": [ - {"property": "datetime"}, - {"interval": ["2023-01-01T00:00:00Z", "2023-12-31T00:00:00Z"]}, - ], - }, - ], - } - - # Define geometry for the image (within dataset bounds) - geometry = Polygon( - coordinates=[ - [ - [-84.45378097481053, 33.6567321707079], - [-84.39805886744838, 33.6567321707079], - [-84.39805886744838, 33.61945681366625], - [-84.45378097481053, 33.61945681366625], - [-84.45378097481053, 33.6567321707079], - ] - ] - ) - - # Create image request with rendering parameters - image_request = ImageParameters( - cql=cql_filter, - zoom=13, - geometry=geometry, - render_parameters=f"assets=image&asset_bidx=image|1,2,3&collection={collection_id}", - columns=1080, - rows=1080, - image_size="1080x1080", - show_branding=False, - ) - - # Create static image - image_response = await client.data.create_static_image( - collection_id=collection_id, body=image_request - ) - - # Extract image ID from the response URL - image_id = image_response.url.split("?")[0].split("/")[-1] - logging.info(f"Created static image with ID: {image_id}") - logging.info(f"Image URL: {image_response.url}") - - return image_id - - -async def get_static_image(client: PlanetaryComputerProClient, collection_id, image_id): - """Retrieve a static image by its ID. - - This demonstrates fetching the actual image data from a previously created static image. - The image data is returned as an iterator of bytes. - """ - # Get static image data - image_data = await client.data.get_static_image( - collection_id=collection_id, id=image_id - ) - - # Join the generator to get bytes - # Collect the async iterator into a list - image_bytes_chunks = [] - async for chunk in image_data: - image_bytes_chunks.append(chunk) - image_bytes = b"".join(image_bytes_chunks) - - # Save the image locally - filename = f"static_image_{image_id}" - with open(filename, "wb") as f: - f.write(image_bytes) - - logging.info(f"Static image saved as: {filename} ({len(image_bytes)} bytes)") - - async def main(): endpoint = os.environ.get("PLANETARYCOMPUTER_ENDPOINT") collection_id = os.environ.get("PLANETARYCOMPUTER_COLLECTION_ID") @@ -292,10 +189,6 @@ async def main(): await get_mosaics_assets_for_point(client, search_id) await get_mosaics_assets_for_tile(client, search_id, collection_id) - # Execute static image operations - image_id = await create_static_image(client, collection_id) - await get_static_image(client, collection_id, image_id) - await client.close() await credential.close() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_06_map_legends_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_06_map_legends_async.py index 95d19941f5e0..cb716e754128 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_06_map_legends_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_06_map_legends_async.py @@ -25,9 +25,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -41,9 +39,7 @@ async def get_class_map_legend(client: "PlanetaryComputerProClient"): async def get_interval_legend(client: "PlanetaryComputerProClient"): """Get an interval legend (continuous color map).""" - result = await client.data.get_interval_legend( - classmap_name=ColorMapNames.MODIS64_A1 - ) + result = await client.data.get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) logging.info(result) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_00_stac_collection.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_00_stac_collection.py index 30214826b636..714a77265561 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_00_stac_collection.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_00_stac_collection.py @@ -48,9 +48,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -62,16 +60,12 @@ def create_collection(client: PlanetaryComputerProClient, collection_id): if any(c.id == collection_id for c in get_all_collections_response["collections"]): logging.info(f"Collection '{collection_id}' already exists, deleting it...") - collection_delete_operation = client.stac.begin_delete_collection( - collection_id, polling=True - ) + collection_delete_operation = client.stac.begin_delete_collection(collection_id, polling=True) collection_delete_operation.result() logging.info(f"Deleted collection '{collection_id}'") # Define collection spatial and temporal extents (Georgia state bounds) - spatial_extent = StacExtensionSpatialExtent( - bounding_box=[[-85.605165, 30.357851, -80.839729, 35.000659]] - ) + spatial_extent = StacExtensionSpatialExtent(bounding_box=[[-85.605165, 30.357851, -80.839729, 35.000659]]) temporal_extent = StacCollectionTemporalExtent( interval=[ [ @@ -149,9 +143,7 @@ def create_collection(client: PlanetaryComputerProClient, collection_id): # Create the collection logging.info(f"Creating collection '{collection_id}'...") - collection_create_operation = client.stac.begin_create_collection( - body=collection_data, polling=False - ) + collection_create_operation = client.stac.begin_create_collection(body=collection_data, polling=False) collection_create_operation.result() logging.info(f"Collection '{collection_id}' created successfully") @@ -176,9 +168,7 @@ def update_collection(client: PlanetaryComputerProClient, collection_id): # Update the collection logging.info("Updating collection...") - client.stac.create_or_replace_collection( - collection_id=collection_id, body=collection - ) + client.stac.replace_collection(collection_id=collection_id, body=collection) # Verify the update updated_collection = client.stac.get_collection(collection_id=collection_id) @@ -199,9 +189,7 @@ def manage_partition_type(client: PlanetaryComputerProClient, collection_id): logging.info("Collection is not empty, skipping partition type update") else: logging.info("Updating partition type to YEAR scheme...") - client.stac.replace_partition_type( - collection_id, body=PartitionType(scheme=PartitionTypeScheme.YEAR) - ) + client.stac.replace_partition_type(collection_id, body=PartitionType(scheme=PartitionTypeScheme.YEAR)) logging.info("Partition type updated successfully") @@ -218,20 +206,12 @@ def manage_render_options(client: PlanetaryComputerProClient, collection_id): ) # Check if render option already exists - stac_collection_mosaics_get_all_response = client.stac.list_render_options( - collection_id=collection_id - ) + stac_collection_mosaics_get_all_response = client.stac.list_render_options(collection_id=collection_id) - if any( - ro.id == render_option.id for ro in stac_collection_mosaics_get_all_response - ): + if any(ro.id == render_option.id for ro in stac_collection_mosaics_get_all_response): logging.info("Render option 'natural-color' already exists.") - client.stac.delete_render_option( - collection_id=collection_id, render_option_id=render_option.id - ) - logging.info( - "Deleted existing render option 'natural-color'. Proceeding to create a new one." - ) + client.stac.delete_render_option(collection_id=collection_id, render_option_id=render_option.id) + logging.info("Deleted existing render option 'natural-color'. Proceeding to create a new one.") # Create render option without description initially render_option = RenderOption( @@ -258,9 +238,7 @@ def manage_render_options(client: PlanetaryComputerProClient, collection_id): ) # Get the created render option - retrieved_option = client.stac.get_render_option( - collection_id=collection_id, render_option_id=render_option.id - ) + retrieved_option = client.stac.get_render_option(collection_id=collection_id, render_option_id=render_option.id) logging.info(f"Retrieved: {retrieved_option.name}") @@ -274,14 +252,10 @@ def manage_mosaics(client: PlanetaryComputerProClient, collection_id): ) # Check existing mosaics - stac_collection_mosaics_get_all_response = client.stac.list_mosaics( - collection_id=collection_id - ) + stac_collection_mosaics_get_all_response = client.stac.list_mosaics(collection_id=collection_id) if any(m.id == mosaic.id for m in stac_collection_mosaics_get_all_response): - logging.info( - f"Mosaic {mosaic.id} already exists. Deleting it before creating a new one." - ) + logging.info(f"Mosaic {mosaic.id} already exists. Deleting it before creating a new one.") client.stac.delete_mosaic(collection_id=collection_id, mosaic_id=mosaic.id) # Create Mosaic @@ -302,9 +276,7 @@ def manage_mosaics(client: PlanetaryComputerProClient, collection_id): logging.info(stac_collection_mosaics_create_or_replace_response) # Get the mosaic - retrieved_mosaic = client.stac.get_mosaic( - collection_id=collection_id, mosaic_id=mosaic.id - ) + retrieved_mosaic = client.stac.get_mosaic(collection_id=collection_id, mosaic_id=mosaic.id) logging.info(retrieved_mosaic) @@ -342,9 +314,7 @@ def get_landing_page(client: PlanetaryComputerProClient): def manage_queryables(client: PlanetaryComputerProClient, collection_id): """Create and manage queryables for a collection.""" - stac_queryables_get_all_response = client.stac.get_collection_queryables( - collection_id=collection_id - ) + stac_queryables_get_all_response = client.stac.get_collection_queryables(collection_id=collection_id) queryable = StacQueryable( name="eo:cloud_cover", @@ -355,13 +325,8 @@ def manage_queryables(client: PlanetaryComputerProClient, collection_id): }, ) - if any( - q == queryable.name - for q in stac_queryables_get_all_response["properties"].keys() - ): - client.stac.delete_queryable( - collection_id=collection_id, queryable_name=queryable.name - ) + if any(q == queryable.name for q in stac_queryables_get_all_response["properties"].keys()): + client.stac.delete_queryable(collection_id=collection_id, queryable_name=queryable.name) logging.info(f"Deleted existing '{queryable.name}' queryable.") stac_queryables_create_response = client.stac.create_queryables( @@ -410,17 +375,13 @@ def manage_collection_assets(client: PlanetaryComputerProClient, collection_id): thumbnail_tuple = ("thumbnail.png", thumbnail_bytes) try: - client.stac.delete_collection_asset( - collection_id=collection_id, asset_id="thumbnail" - ) + client.stac.delete_collection_asset(collection_id=collection_id, asset_id="thumbnail") logging.info("Deleted existing thumbnail asset.") except Exception: logging.info("No existing thumbnail asset to delete.") # Create Collection Asset - client.stac.create_collection_asset( - collection_id=collection_id, body={"data": data, "file": thumbnail_tuple} - ) + client.stac.create_collection_asset(collection_id=collection_id, body={"data": data, "file": thumbnail_tuple}) # Create or replace Collection Asset thumbnail_bytes.seek(0) # Reset BytesIO position @@ -439,9 +400,7 @@ def manage_collection_assets(client: PlanetaryComputerProClient, collection_id): ) # Get the thumbnail as bytes - thumbnail_response = client.stac.get_collection_thumbnail( - collection_id=collection_id - ) + thumbnail_response = client.stac.get_collection_thumbnail(collection_id=collection_id) # Convert the generator to bytes thumbnail_bytes_result = b"".join(thumbnail_response) @@ -459,9 +418,7 @@ def main(): # Create client credential = DefaultAzureCredential() - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=credential, logging_enable=True - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential, logging_enable=True) logging.info(f"Connected to: {endpoint}") logging.info(f"Collection ID: {collection_id}\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_01_ingestion_management.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_01_ingestion_management.py index f207d51dce88..6403b1bc83e4 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_01_ingestion_management.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_01_ingestion_management.py @@ -129,7 +129,9 @@ def create_or_replace_source( logging.info(f"First call result: {first_result.id}") # Second call - replaces again with modified token (demonstrates update capability) - updated_token = "sp=rl&st=2024-01-01T00:00:00Z&se=2024-12-31T23:59:59Z&sv=2023-01-03&sr=c&sig=UpdatedRandomSignature123456" + updated_token = ( + "sp=rl&st=2024-01-01T00:00:00Z&se=2024-12-31T23:59:59Z&sv=2023-01-03&sr=c&sig=UpdatedRandomSignature123456" + ) updated_connection_info = SharedAccessSignatureTokenConnection( container_uri=sas_container_uri, shared_access_signature_token=updated_token @@ -317,7 +319,8 @@ def manage_operations(client: PlanetaryComputerProClient): logging.info(f"Failed to cancel operation {operation.id}: {e.message}") pass - # Cancel all operations + # Cancel all operations across the entire GeoCatalog instance. + # WARNING: This cancels ALL pending/running operations, not just those for a specific collection. try: client.ingestion.cancel_all_operations() except HttpResponseError as e: diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_02_stac_specification.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_02_stac_specification.py index a0cfb9f890f5..650f165ea273 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_02_stac_specification.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_02_stac_specification.py @@ -47,9 +47,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -68,11 +66,7 @@ def search_collections(client: PlanetaryComputerProClient): # Show first few collections for collection in collections.collections[:3]: if collection.description: - desc = ( - collection.description[:100] + "..." - if len(collection.description) > 100 - else collection.description - ) + desc = collection.description[:100] + "..." if len(collection.description) > 100 else collection.description logging.info(f" - {collection.id}: {desc}") @@ -102,11 +96,7 @@ def search_items(client: PlanetaryComputerProClient, collection_id): ], }, date_time="2021-01-01T00:00:00Z/2022-12-31T00:00:00Z", - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.DESC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.DESC)], limit=50, ) @@ -231,19 +221,13 @@ def get_sample_stac_item(collection_id: str, item_id: str) -> StacItem: def create_stac_item(client: PlanetaryComputerProClient, collection_id, item_id): """Create a STAC item.""" stac_item = get_sample_stac_item(collection_id, item_id) - stac_item_get_items_response = client.stac.get_item_collection( - collection_id=collection_id - ) + stac_item_get_items_response = client.stac.get_item_collection(collection_id=collection_id) for item in stac_item_get_items_response.features: logging.error(item.id) if any(item.id == stac_item.id for item in stac_item_get_items_response.features): - logging.info( - f"Item {stac_item.id} already exists. Deleting it before creating a new one." - ) - client.stac.begin_delete_item( - collection_id=collection_id, item_id=stac_item.id, polling=True - ).result() + logging.info(f"Item {stac_item.id} already exists. Deleting it before creating a new one.") + client.stac.begin_delete_item(collection_id=collection_id, item_id=stac_item.id, polling=True).result() logging.info(f"Deleted item {stac_item.id}. Proceeding to create a new one.") else: logging.info(f"Item {stac_item.id} does not exist. Proceeding to create it.") @@ -271,28 +255,22 @@ def update_stac_item(client: PlanetaryComputerProClient, collection_id, item_id) ) stac_item_create_or_update_response.result() - logging.info( - f"Updated item {stac_item.id}, platform: {stac_item.properties['platform']}" - ) + logging.info(f"Updated item {stac_item.id}, platform: {stac_item.properties['platform']}") -def create_or_replace_stac_item( - client: PlanetaryComputerProClient, collection_id, item_id -): +def create_or_replace_stac_item(client: PlanetaryComputerProClient, collection_id, item_id): """Create or replace a STAC item (idempotent operation). - This demonstrates using begin_create_or_replace_item which is idempotent: + This demonstrates using begin_replace_item: - First ensures item exists by creating it with begin_create_item - - Then demonstrates replace using begin_create_or_replace_item + - Then demonstrates replace using begin_replace_item - Multiple calls with the same data produce the same result """ # First, create the item using begin_create_item stac_item = get_sample_stac_item(collection_id, item_id) try: - create_poller = client.stac.begin_create_item( - collection_id=collection_id, body=stac_item, polling=True - ) + create_poller = client.stac.begin_create_item(collection_id=collection_id, body=stac_item, polling=True) create_poller.result() logging.info(f"Created item {item_id}") except ResourceExistsError: @@ -306,7 +284,7 @@ def create_or_replace_stac_item( stac_item.properties["platform"] = "Imagery Updated" stac_item.properties["processing_level"] = "L2" - replace_poller = client.stac.begin_create_or_replace_item( + replace_poller = client.stac.begin_replace_item( collection_id=collection_id, item_id=item_id, body=stac_item, polling=True ) replace_poller.result() @@ -314,9 +292,7 @@ def create_or_replace_stac_item( # Verify replacement replaced_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) - logging.info( - f"Verified replaced item, platform: {replaced_item.properties.get('platform', 'N/A')}" - ) + logging.info(f"Verified replaced item, platform: {replaced_item.properties.get('platform', 'N/A')}") def delete_stac_item(client: PlanetaryComputerProClient, collection_id, item_id): @@ -327,24 +303,18 @@ def delete_stac_item(client: PlanetaryComputerProClient, collection_id, item_id) """ try: # Check if item exists before attempting deletion - existing_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + existing_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) logging.info(f"Found item {existing_item.id} to delete") # Delete the item using begin_delete_item - delete_poller = client.stac.begin_delete_item( - collection_id=collection_id, item_id=item_id, polling=True - ) + delete_poller = client.stac.begin_delete_item(collection_id=collection_id, item_id=item_id, polling=True) delete_poller.result() logging.info(f"Successfully deleted item {item_id}") # Verify deletion by attempting to retrieve the item try: client.stac.get_item(collection_id=collection_id, item_id=item_id) - logging.warning( - f"Item {item_id} still exists after deletion (may take time to propagate)" - ) + logging.warning(f"Item {item_id} still exists after deletion (may take time to propagate)") except ResourceNotFoundError: logging.info(f"Verified item {item_id} was successfully deleted") @@ -380,11 +350,7 @@ def query_items(client: PlanetaryComputerProClient, collection_id): # Sorted query sorted_options = StacSearchParameters( collections=[collection_id], - sort_by=[ - StacSortExtension( - field="eo:cloud_cover", direction=StacSearchSortingDirection.ASC - ) - ], + sort_by=[StacSortExtension(field="eo:cloud_cover", direction=StacSearchSortingDirection.ASC)], limit=3, ) @@ -403,9 +369,7 @@ def get_queryables(client: PlanetaryComputerProClient, collection_id): if properties: for prop_name in list(properties.keys())[:10]: # Show first 10 - logging.info( - f" - {prop_name}: {properties[prop_name].get('description', '')}" - ) + logging.info(f" - {prop_name}: {properties[prop_name].get('description', '')}") def main(): @@ -419,9 +383,7 @@ def main(): # Create client credential = DefaultAzureCredential() - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=credential, logging_enable=False - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=credential, logging_enable=False) # Execute STAC specification operations get_landing_page(client) @@ -434,9 +396,7 @@ def main(): create_stac_item(client, collection_id, item_id) update_stac_item(client, collection_id, item_id) create_or_replace_stac_item(client, collection_id, f"{item_id}_replace_demo") - delete_stac_item( - client, collection_id, f"{item_id}_replace_demo" - ) # Clean up the item created above + delete_stac_item(client, collection_id, f"{item_id}_replace_demo") # Clean up the item created above get_collection(client, collection_id) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_03_shared_access_signature.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_03_shared_access_signature.py index 701b7be5f029..68a146aa5056 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_03_shared_access_signature.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_03_shared_access_signature.py @@ -35,7 +35,7 @@ def generate_sas_token(client: PlanetaryComputerProClient, collection_id: str): """Generate a SAS token for a collection.""" - get_token_response = client.shared_access_signature.get_token(collection_id=collection_id, duration_in_minutes=60) + get_token_response = client.sas.get_token(collection_id=collection_id, duration_in_minutes=60) return get_token_response @@ -54,7 +54,7 @@ def sign_asset_href(client: PlanetaryComputerProClient, collection_id: str): else: raise Exception("No thumbnail found in collection assets.") - get_sign_response = client.shared_access_signature.get_sign(href=href, duration_in_minutes=60) + get_sign_response = client.sas.get_sign(href=href, duration_in_minutes=60) return get_sign_response.href, href # Return both signed and unsigned hrefs @@ -80,7 +80,7 @@ def download_asset(signed_href: str): def revoke_token(client: PlanetaryComputerProClient): """Revoke the current SAS token.""" - revoke_token_response = client.shared_access_signature.revoke_token() + revoke_token_response = client.sas.revoke_token() return revoke_token_response diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_04_stac_item_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_04_stac_item_tiler.py index c224d90aac58..108146f4d9a4 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_04_stac_item_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_04_stac_item_tiler.py @@ -31,9 +31,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -47,9 +45,7 @@ def display_response(response, filename): def get_tile_matrix_definitions(client: PlanetaryComputerProClient): """Get tile matrix definitions for WebMercatorQuad.""" - result = client.data.get_tile_matrix_definitions( - tile_matrix_set_id="WebMercatorQuad" - ) + result = client.data.get_tile_matrix_definitions(tile_matrix_set_id="WebMercatorQuad") logging.info(result) @@ -61,17 +57,13 @@ def list_tile_matrices(client: PlanetaryComputerProClient): def get_asset_statistics(client: PlanetaryComputerProClient, collection_id, item_id): """Get asset statistics for an item.""" - result = client.data.get_asset_statistics( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result = client.data.get_item_asset_statistics(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info(result) def list_available_assets(client: PlanetaryComputerProClient, collection_id, item_id): """List available assets for an item.""" - result = client.data.list_available_assets( - collection_id=collection_id, item_id=item_id - ) + result = client.data.list_item_available_assets(collection_id=collection_id, item_id=item_id) logging.info(result) @@ -83,57 +75,49 @@ def get_item_asset_details(client: PlanetaryComputerProClient, collection_id, it """ # Get info for specific assets - result_specific = client.data.get_item_asset_details( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result_specific = client.data.get_item_info(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info("Assets info (image asset only):") logging.info(f" Dataset: {result_specific}") def get_bounds(client: PlanetaryComputerProClient, collection_id, item_id): """List bounds for an item.""" - result = client.data.get_bounds(collection_id=collection_id, item_id=item_id) + result = client.data.get_item_bounds(collection_id=collection_id, item_id=item_id) logging.info(result) def crop_geo_json(client: PlanetaryComputerProClient, collection_id, item_id, geojson): """Crop an item using GeoJSON geometry.""" - crop_geo_json_response = client.data.crop_geo_json( + crop_geo_json_response = client.data.crop_feature_geo_json( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], body=geojson, ) logging.info("Cropping with GeoJSON completed") display_response(crop_geo_json_response, f"crop_geojson_{item_id}.png") -def crop_geo_json_with_dimensions( - client: PlanetaryComputerProClient, collection_id, item_id, geojson -): +def crop_geo_json_with_dimensions(client: PlanetaryComputerProClient, collection_id, item_id, geojson): """Crop an item using GeoJSON geometry with specific dimensions.""" - crop_geo_json_with_dimensions_response = client.data.crop_geo_json_with_dimensions( + crop_geo_json_with_dimensions_response = client.data.crop_feature_geo_json_width_by_height( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], body=geojson, ) - display_response( - crop_geo_json_with_dimensions_response, f"crop_geojson_dims_{item_id}.png" - ) + display_response(crop_geo_json_with_dimensions_response, f"crop_geojson_dims_{item_id}.png") -def get_geo_json_statistics( - client: PlanetaryComputerProClient, collection_id, item_id, geojson -): +def get_geo_json_statistics(client: PlanetaryComputerProClient, collection_id, item_id, geojson): """Get statistics for a GeoJSON area.""" - result = client.data.get_geo_json_statistics( + result = client.data.get_item_geo_json_statistics( collection_id=collection_id, item_id=item_id, body=geojson, assets=["image"] ) logging.info(result) @@ -141,15 +125,13 @@ def get_geo_json_statistics( def get_info_geo_json(client: PlanetaryComputerProClient, collection_id, item_id): """Get info for GeoJSON.""" - result = client.data.get_info_geo_json( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result = client.data.get_item_info_geo_json(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info(result) def get_part(client: PlanetaryComputerProClient, collection_id, item_id, bounds): """Get a part of an item with specific bounds.""" - get_part_response = client.data.get_part( + get_part_response = client.data.get_item_bbox_crop( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, @@ -160,16 +142,14 @@ def get_part(client: PlanetaryComputerProClient, collection_id, item_id, bounds) width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) display_response(get_part_response, f"part_{item_id}.png") -def get_part_with_dimensions( - client: PlanetaryComputerProClient, collection_id, item_id, bounds -): +def get_part_with_dimensions(client: PlanetaryComputerProClient, collection_id, item_id, bounds): """Get a part of an item with specific bounds and dimensions.""" - get_part_with_dimensions_response = client.data.get_part_with_dimensions( + get_part_with_dimensions_response = client.data.get_item_bbox_crop_with_dimensions( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, @@ -180,63 +160,61 @@ def get_part_with_dimensions( width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) display_response(get_part_with_dimensions_response, f"part_dims_{item_id}.png") def get_point(client: PlanetaryComputerProClient, collection_id, item_id, point): """Get point value at a specific location.""" - result = client.data.get_point( + result = client.data.get_item_point( collection_id=collection_id, item_id=item_id, assets=["image"], longitude=point[0], latitude=point[1], - no_data=0, + no_data="0", ) logging.info(f"Point values at ({point[0]}, {point[1]}): {result}") def get_preview(client: PlanetaryComputerProClient, collection_id, item_id): """Get a preview of an item.""" - get_preview_response = client.data.get_preview( + get_preview_response = client.data.get_item_preview( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) display_response(get_preview_response, f"preview_{item_id}.png") def get_preview_with_format(client: PlanetaryComputerProClient, collection_id, item_id): """Get a preview of an item with specific format.""" - get_preview_with_format_response = client.data.get_preview_with_format( + get_preview_with_format_response = client.data.get_item_preview_with_format( collection_id=collection_id, item_id=item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) display_response(get_preview_with_format_response, f"preview_format_{item_id}.png") def list_statistics(client: PlanetaryComputerProClient, collection_id, item_id): """List statistics for an item.""" - result = client.data.list_statistics( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result = client.data.list_item_statistics(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info(result) def get_tile_json(client: PlanetaryComputerProClient, collection_id, item_id): """Get TileJSON for an item.""" - result = client.data.get_tile_json( + result = client.data.get_item_tile_json( collection_id=collection_id, item_id=item_id, tile_matrix_set_id="WebMercatorQuad", @@ -245,7 +223,7 @@ def get_tile_json(client: PlanetaryComputerProClient, collection_id, item_id): min_zoom=7, max_zoom=14, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) logging.info(result) @@ -262,16 +240,14 @@ def get_tile(client: PlanetaryComputerProClient, collection_id, item_id): scale=1, format="png", assets=["image"], - asset_band_indices="image|1,2,3", - ) - display_response( - get_tile_with_matrix_set_response, f"tile_{item_id}_z14_x4349_y6564.png" + asset_band_indices=["image|1,2,3"], ) + display_response(get_tile_with_matrix_set_response, f"tile_{item_id}_z14_x4349_y6564.png") def get_wmts_capabilities(client: PlanetaryComputerProClient, collection_id, item_id): """Get WMTS capabilities and save it locally.""" - get_wmts_capabilities_response = client.data.get_wmts_capabilities( + get_wmts_capabilities_response = client.data.get_item_wmts_capabilities( collection_id=collection_id, item_id=item_id, tile_matrix_set_id="WebMercatorQuad", @@ -280,7 +256,7 @@ def get_wmts_capabilities(client: PlanetaryComputerProClient, collection_id, ite min_zoom=7, max_zoom=14, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) xml_bytes = b"".join(get_wmts_capabilities_response) xml_string = xml_bytes.decode("utf-8") @@ -300,9 +276,7 @@ def main(): collection_id = os.environ.get("PLANETARYCOMPUTER_COLLECTION_ID") item_id = "ga_m_3308421_se_16_060_20211114" - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=DefaultAzureCredential() - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) # Define geometry for operations geometry = Polygon( diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py index 1f615ff2314a..6c1470affac8 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py @@ -26,15 +26,13 @@ StacSortExtension, StacSearchSortingDirection, TilerImageFormat, - ImageParameters, - Polygon, + + ) import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -56,38 +54,30 @@ def register_mosaics_search(client: PlanetaryComputerProClient, collection_id): ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_search_response = client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_search_response = client.data.register_mosaics_search(register_search_request) logging.info(register_search_response) return register_search_response def get_mosaics_search_info(client: PlanetaryComputerProClient, search_id): """Get mosaics search info.""" - mosaics_info_search_response = client.data.get_mosaics_search_info( - search_id=search_id - ) + mosaics_info_search_response = client.data.get_searches_info(search_id=search_id) search = mosaics_info_search_response.search return search def get_mosaics_tile_json(client: PlanetaryComputerProClient, search_id, collection_id): """Get mosaics tile JSON.""" - get_mosaics_tile_json_response = client.data.get_mosaics_tile_json( + get_mosaics_tile_json_response = client.data.get_searches_tile_json( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], tile_scale=1, min_zoom=9, - collection=collection_id, + collection_id=collection_id, tile_format="png", ) logging.info(get_mosaics_tile_json_response.as_dict()) @@ -95,7 +85,7 @@ def get_mosaics_tile_json(client: PlanetaryComputerProClient, search_id, collect def get_mosaics_tile(client: PlanetaryComputerProClient, search_id, collection_id): """Get a mosaic tile and save it locally.""" - mosaics_tile_matrix_sets_response = client.data.get_mosaics_tile( + mosaics_tile_matrix_sets_response = client.data.get_searches_tile_by_scale_and_format( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -104,7 +94,7 @@ def get_mosaics_tile(client: PlanetaryComputerProClient, search_id, collection_i scale=1, format="png", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], collection=collection_id, ) mosaics_tile_matrix_sets_bytes = b"".join(mosaics_tile_matrix_sets_response) @@ -113,14 +103,12 @@ def get_mosaics_tile(client: PlanetaryComputerProClient, search_id, collection_i filename = f"mosaic_tile_{search_id}_z13_x2174_y3282.png" with open(filename, "wb") as f: f.write(mosaics_tile_matrix_sets_bytes) - logging.info( - f"Tile saved as: {filename} ({len(mosaics_tile_matrix_sets_bytes)} bytes)" - ) + logging.info(f"Tile saved as: {filename} ({len(mosaics_tile_matrix_sets_bytes)} bytes)") def get_mosaics_wmts_capabilities(client: PlanetaryComputerProClient, search_id): """Get WMTS capabilities for mosaics and save it locally.""" - get_capabilities_xml_response = client.data.get_mosaics_wmts_capabilities( + get_capabilities_xml_response = client.data.get_searches_wmts_capabilities( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", tile_format=TilerImageFormat.PNG, @@ -128,7 +116,7 @@ def get_mosaics_wmts_capabilities(client: PlanetaryComputerProClient, search_id) min_zoom=7, max_zoom=13, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) xml_bytes = b"".join(get_capabilities_xml_response) xml_string = xml_bytes.decode("utf-8") @@ -143,7 +131,7 @@ def get_mosaics_wmts_capabilities(client: PlanetaryComputerProClient, search_id) def get_mosaics_assets_for_point(client: PlanetaryComputerProClient, search_id): """Get mosaic assets for a specific point (center of the bbox).""" # Using center point from the coordinate bbox: -84.43202751899601, 33.639647639722273 - get_lon_lat_assets_response = client.data.get_mosaics_assets_for_point( + get_lon_lat_assets_response = client.data.get_searches_point_with_assets( search_id=search_id, longitude=-84.43202751899601, latitude=33.639647639722273, @@ -157,11 +145,9 @@ def get_mosaics_assets_for_point(client: PlanetaryComputerProClient, search_id): logging.info(f"Assets for point: {get_lon_lat_assets_response[0]['id']}") -def get_mosaics_assets_for_tile( - client: PlanetaryComputerProClient, search_id, collection_id -): +def get_mosaics_assets_for_tile(client: PlanetaryComputerProClient, search_id, collection_id): """Get mosaic assets for a specific tile.""" - result = client.data.get_mosaics_assets_for_tile( + result = client.data.get_searches_assets_for_tile( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -172,85 +158,6 @@ def get_mosaics_assets_for_tile( logging.info(f"Assets for tile: {result}") -def create_static_image(client: PlanetaryComputerProClient, collection_id): - """Create a static image from a STAC item. - - This demonstrates creating a static image tile with specific rendering parameters. - The image is created asynchronously and can be retrieved using the returned image ID. - """ - # Define CQL filter with date range - cql_filter = { - "op": "and", - "args": [ - {"op": "=", "args": [{"property": "collection"}, collection_id]}, - { - "op": "anyinteracts", - "args": [ - {"property": "datetime"}, - {"interval": ["2023-01-01T00:00:00Z", "2023-12-31T00:00:00Z"]}, - ], - }, - ], - } - - # Define geometry for the image (within dataset bounds) - geometry = Polygon( - coordinates=[ - [ - [-84.45378097481053, 33.6567321707079], - [-84.39805886744838, 33.6567321707079], - [-84.39805886744838, 33.61945681366625], - [-84.45378097481053, 33.61945681366625], - [-84.45378097481053, 33.6567321707079], - ] - ] - ) - - # Create image request with rendering parameters - image_request = ImageParameters( - cql=cql_filter, - zoom=13, - geometry=geometry, - render_parameters=f"assets=image&asset_bidx=image|1,2,3&collection={collection_id}", - columns=1080, - rows=1080, - image_size="1080x1080", - show_branding=False, - ) - - # Create static image - image_response = client.data.create_static_image( - collection_id=collection_id, body=image_request - ) - - # Extract image ID from the response URL - image_id = image_response.url.split("?")[0].split("/")[-1] - logging.info(f"Created static image with ID: {image_id}") - logging.info(f"Image URL: {image_response.url}") - - return image_id - - -def get_static_image(client: PlanetaryComputerProClient, collection_id, image_id): - """Retrieve a static image by its ID. - - This demonstrates fetching the actual image data from a previously created static image. - The image data is returned as an iterator of bytes. - """ - # Get static image data - image_data = client.data.get_static_image(collection_id=collection_id, id=image_id) - - # Join the generator to get bytes - image_bytes = b"".join(image_data) - - # Save the image locally - filename = f"static_image_{image_id}" - with open(filename, "wb") as f: - f.write(image_bytes) - - logging.info(f"Static image saved as: {filename} ({len(image_bytes)} bytes)") - - def main(): endpoint = os.environ.get("PLANETARYCOMPUTER_ENDPOINT") collection_id = os.environ.get("PLANETARYCOMPUTER_COLLECTION_ID") @@ -258,9 +165,7 @@ def main(): assert endpoint is not None assert collection_id is not None - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=DefaultAzureCredential() - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) # Execute mosaic tiler operations register_search_response = register_mosaics_search(client, collection_id) @@ -273,10 +178,6 @@ def main(): get_mosaics_assets_for_point(client, search_id) get_mosaics_assets_for_tile(client, search_id, collection_id) - # Execute static image operations - image_id = create_static_image(client, collection_id) - get_static_image(client, collection_id, image_id) - if __name__ == "__main__": main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_06_map_legends.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_06_map_legends.py index 484ea7b65915..c2ede393ceb1 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_06_map_legends.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_06_map_legends.py @@ -24,9 +24,7 @@ import logging # Enable HTTP request/response logging -logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( - logging.ERROR -) +logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.ERROR) logging.basicConfig(level=logging.INFO) @@ -63,9 +61,7 @@ def main(): if not endpoint: raise ValueError("PLANETARYCOMPUTER_ENDPOINT environment variable must be set") - client = PlanetaryComputerProClient( - endpoint=endpoint, credential=DefaultAzureCredential() - ) + client = PlanetaryComputerProClient(endpoint=endpoint, credential=DefaultAzureCredential()) get_class_map_legend(client) get_interval_legend(client) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test.py b/sdk/planetarycomputer/azure-planetarycomputer/test.py new file mode 100644 index 000000000000..89dd1117f980 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/test.py @@ -0,0 +1,18 @@ +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.identity import DefaultAzureCredential + +client = PlanetaryComputerProClient( + endpoint="https://pctiler2026.fsgcc8ava0apb2a5.uksouth.geocatalog.ppe.spatio.azure-test.net", + credential=DefaultAzureCredential(), +) + +# get_collection() says it returns pystac.Collection +collection = client.stac.get_collection(collection_id="karthick-example-collection") + +print(collection) + +# So you SHOULD be able to do this (pystac API): +print(collection.id) # "naip" +print(collection.title) # "NAIP Imagery" +print(collection.extent) # pystac Extent object +print(type(collection)) # diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py new file mode 100644 index 000000000000..161a502acc01 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py @@ -0,0 +1,165 @@ +# pylint: disable=line-too-long,useless-suppression +""" +Test cancel_all_operations() scope. + +Creates two temporary collections, starts create-item LROs on both, +then calls cancel_all_operations() and checks if operations across +ALL collections get cancelled. + +Usage: + python test_cancel_all_operations.py +""" + +import time +from azure.planetarycomputer import PlanetaryComputerProClient +from azure.planetarycomputer.models import ( + StacCollection, + StacExtensionSpatialExtent, + StacCollectionTemporalExtent, + StacExtensionExtent, + StacItem, +) +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import ResourceNotFoundError + +ENDPOINT = "https://stablegeo.eebtfbh5h4bffxbf.uksouth.geocatalog.spatio.azure.com" + +COLLECTION_A = "cancel-test-collection-a" +COLLECTION_B = "cancel-test-collection-b" + + +def make_item(item_id, collection_id): + return { + "stac_version": "1.0.0", + "type": "Feature", + "id": item_id, + "collection": collection_id, + "bbox": [-84.44, 33.62, -84.37, 33.69], + "geometry": { + "type": "Polygon", + "coordinates": [[[-84.37, 33.62], [-84.37, 33.69], [-84.44, 33.69], [-84.44, 33.62], [-84.37, 33.62]]], + }, + "properties": {"datetime": "2021-11-14T16:00:00Z"}, + "links": [ + { + "rel": "collection", + "type": "application/json", + "href": f"./collections/{collection_id}", + } + ], + "assets": { + "image": { + "href": "https://naipeuwest.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": ["data"], + } + }, + } + + +def create_collection(client, collection_id): + try: + client.stac.get_collection(collection_id=collection_id) + print(f" {collection_id} already exists, deleting...") + client.stac.begin_delete_collection(collection_id=collection_id).result() + except ResourceNotFoundError: + pass + + col = StacCollection( + id=collection_id, + description=f"Temp collection for cancel test", + license="proprietary", + extent=StacExtensionExtent( + spatial=StacExtensionSpatialExtent(bounding_box=[[-180, -90, 180, 90]]), + temporal=StacCollectionTemporalExtent(interval=[[None, None]]), + ), + links=[], + stac_version="1.0.0", + type="Collection", + ) + client.stac.begin_create_collection(body=col).result() + print(f" Created {collection_id}") + + +def main(): + credential = DefaultAzureCredential() + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=credential) + + # Step 1: Create two collections + print("=== Step 1: Create test collections ===") + create_collection(client, COLLECTION_A) + create_collection(client, COLLECTION_B) + + # Step 2: Start item create operations on both (use polling=False to not wait) + print("\n=== Step 2: Start operations on both collections ===") + for i in range(3): + for col_id in [COLLECTION_A, COLLECTION_B]: + item = make_item(f"test-item-{col_id[-1]}-{i}", col_id) + try: + poller = client.stac.begin_create_item(collection_id=col_id, body=item, polling=False) + print(f" Started create '{item['id']}' in {col_id}") + except Exception as e: + print(f" Error starting '{item['id']}' in {col_id}: {e}") + + # Step 3: Check pending operations (only for our test collections) + print("\n=== Step 3: Operations before cancel ===") + test_collections = {COLLECTION_A, COLLECTION_B} + + ops_a = list(client.ingestion.list_operations(collection_id=COLLECTION_A)) + ops_b = list(client.ingestion.list_operations(collection_id=COLLECTION_B)) + print(f" {COLLECTION_A}: {len(ops_a)} operations") + for op in ops_a: + print(f" {op.id} | status={op.status} | type={op.type}") + print(f" {COLLECTION_B}: {len(ops_b)} operations") + for op in ops_b: + print(f" {op.id} | status={op.status} | type={op.type}") + + pending_before = [op for op in ops_a + ops_b if "PENDING" in str(op.status) or "RUNNING" in str(op.status)] + print(f"\n Pending/Running across test collections: {len(pending_before)}") + + # Step 4: Cancel all operations + print("\n=== Step 4: Calling cancel_all_operations() ===") + client.ingestion.cancel_all_operations() + print("cancel_all_operations() completed") + + # Step 5: Check operations after cancel (focused on test collections) + time.sleep(2) + print("\n=== Step 5: Operations after cancel ===") + ops_a_after = list(client.ingestion.list_operations(collection_id=COLLECTION_A)) + ops_b_after = list(client.ingestion.list_operations(collection_id=COLLECTION_B)) + print(f" {COLLECTION_A}: {len(ops_a_after)} operations") + for op in ops_a_after: + print(f" {op.id} | status={op.status} | type={op.type}") + print(f" {COLLECTION_B}: {len(ops_b_after)} operations") + for op in ops_b_after: + print(f" {op.id} | status={op.status} | type={op.type}") + + cancelled = [op for op in ops_a_after + ops_b_after if "CANCELED" in str(op.status)] + print(f"\n Cancelled across BOTH test collections: {len(cancelled)}") + if cancelled: + collections_cancelled = set(op.collection_id for op in cancelled) + print(f" Collections with cancelled ops: {collections_cancelled}") + if len(collections_cancelled) > 1: + print(" CONFIRMED: cancel_all_operations() affects MULTIPLE collections (catalog-wide)") + else: + print(" Only one collection affected") + + # Also check if ops from OTHER collections got cancelled + all_ops_after = list(client.ingestion.list_operations()) + all_cancelled = [op for op in all_ops_after if "CANCELED" in str(op.status)] + cancelled_collections = set(op.collection_id for op in all_cancelled) + print(f"\n Total CANCELED operations across catalog: {len(all_cancelled)}") + print(f" Collections with CANCELED ops: {cancelled_collections}") + + # Step 7: Cleanup + print("\n=== Step 7: Cleanup ===") + for col_id in [COLLECTION_A, COLLECTION_B]: + try: + client.stac.begin_delete_collection(collection_id=col_id).result() + print(f" Deleted {col_id}") + except Exception as e: + print(f" Cleanup {col_id}: {e}") + + +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py b/sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py new file mode 100644 index 000000000000..6505ddc8a4fb --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py @@ -0,0 +1,95 @@ +""" +Test replace_collection returns HTTP 200 for both +creating a new collection and replacing an existing one. + +Usage: + python test_collection_status_code.py +""" + +from azure.core.exceptions import ResourceNotFoundError, HttpResponseError +from azure.identity import DefaultAzureCredential +from azure.planetarycomputer import PlanetaryComputerProClient + +GEOCATALOG_ENDPOINT = "https://stablegeo.eebtfbh5h4bffxbf.uksouth.geocatalog.spatio.azure.com" +TEST_COLLECTION_ID = "test-status-code-check" + + +def capture_status_code(client, collection_id, body): + """Call replace_collection and return (result, status_code).""" + raw_response = None + + def capture_response(pipeline_response, deserialized, headers): + nonlocal raw_response + raw_response = pipeline_response.http_response + return deserialized + + result = client.stac.replace_collection( + collection_id=collection_id, + body=body, + cls=capture_response, + ) + return result, raw_response.status_code + + +def main(): + credential = DefaultAzureCredential() + client = PlanetaryComputerProClient(endpoint=GEOCATALOG_ENDPOINT, credential=credential) + + # Clean up any leftover from a previous run + try: + client.stac.get_collection(collection_id=TEST_COLLECTION_ID) + print(f"Collection '{TEST_COLLECTION_ID}' already exists, deleting first...") + client.stac.begin_delete_collection(collection_id=TEST_COLLECTION_ID).result() + print("Deleted.") + except ResourceNotFoundError: + print(f"Collection '{TEST_COLLECTION_ID}' does not exist (good, starting clean).") + + # Minimal STAC collection body + collection_body = { + "id": TEST_COLLECTION_ID, + "type": "Collection", + "title": "Test Collection for Status Code Check", + "description": "Temporary collection to verify HTTP status codes.", + "license": "proprietary", + "extent": { + "spatial": {"bbox": [[-180, -90, 180, 90]]}, + "temporal": {"interval": [["2020-01-01T00:00:00Z", None]]}, + }, + "links": [], + } + + # --- Test 1: CREATE (collection does not exist) --- + print("\n--- Test 1: CREATE new collection ---") + try: + result, status_code = capture_status_code(client, TEST_COLLECTION_ID, collection_body) + print(f"HTTP status code: {status_code}") + print(f"Collection returned: {result['id']}") + assert status_code == 200, f"Expected 200, got {status_code}" + print("PASS: create (new) returned 200") + except HttpResponseError as e: + print(f"FAIL: HttpResponseError — status {e.status_code}, message: {e.message}") + print("This may mean the service returned 201 for create, which the SDK does not accept.") + + # --- Test 2: REPLACE (collection already exists) --- + print("\n--- Test 2: REPLACE existing collection ---") + collection_body["description"] = "Updated description to test replace." + try: + result, status_code = capture_status_code(client, TEST_COLLECTION_ID, collection_body) + print(f"HTTP status code: {status_code}") + print(f"Collection returned: {result['id']}") + assert status_code == 200, f"Expected 200, got {status_code}" + print("PASS: replace (existing) returned 200") + except HttpResponseError as e: + print(f"FAIL: HttpResponseError — status {e.status_code}, message: {e.message}") + + # --- Cleanup --- + print("\n--- Cleanup ---") + try: + client.stac.begin_delete_collection(collection_id=TEST_COLLECTION_ID).result() + print(f"Deleted test collection '{TEST_COLLECTION_ID}'.") + except Exception as e: + print(f"Cleanup warning: {e}") + + +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py b/sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py new file mode 100644 index 000000000000..04d6155d2a05 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py @@ -0,0 +1,363 @@ +""" +Validate that all README code samples work against the stable GeoCatalog. + +Runs each read-only sample from the README and validates mutating samples +(create/delete) in a safe lifecycle test with cleanup. + +Usage: + python test_readme_samples.py +""" + +import asyncio +import os +import traceback + +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError, ResourceNotFoundError + +ENDPOINT = "https://stablegeo.eebtfbh5h4bffxbf.uksouth.geocatalog.spatio.azure.com" +COLLECTION_ID = "naip" +ITEM_ID = "ga_m_3308421_se_16_060_20211114" + +results = [] + + +def run_sample(name, func): + """Run a sample and record pass/fail.""" + print(f"\n{'='*60}") + print(f"TESTING: {name}") + print(f"{'='*60}") + try: + func() + print(f"PASS: {name}") + results.append((name, "PASS", None)) + except Exception as e: + print(f"FAIL: {name} — {e}") + traceback.print_exc() + results.append((name, "FAIL", str(e))) + + +# ============================================================ +# README Sample: List STAC Collections +# ============================================================ +def test_list_collections(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + collections_response = client.stac.get_collections() + + for collection in collections_response.collections: + print(f"Collection: {collection.id}") + print(f" Title: {collection.title}") + print(f" Description: {collection.description[:100]}...") + break # Just verify the first one + + assert len(collections_response.collections) > 0, "No collections returned" + + +# ============================================================ +# README Sample: Search for STAC Items +# ============================================================ +def test_search_items(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.planetarycomputer.models import StacSearchParameters, FilterLanguage + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + search_params = StacSearchParameters( + collections=[COLLECTION_ID], + filter_lang=FilterLanguage.CQL2_JSON, + filter={ + "op": "s_intersects", + "args": [ + {"property": "geometry"}, + { + "type": "Polygon", + "coordinates": [ + [[-84.39, 33.76], [-84.37, 33.76], [-84.37, 33.78], [-84.39, 33.78], [-84.39, 33.76]] + ], + }, + ], + }, + limit=10, + ) + + search_result = client.stac.search(body=search_params) + print(f"Found {len(search_result.features)} items") + assert search_result.features is not None, "Search response missing features" + + +# ============================================================ +# README Sample: Get STAC Item Details +# ============================================================ +def test_get_item(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + item = client.stac.get_item( + collection_id=COLLECTION_ID, + item_id=ITEM_ID, + ) + + print(f"Item ID: {item.id}") + print(f"Geometry type: {item.geometry.type}") + print(f"Assets: {list(item.assets.keys())}") + + assert item.id == ITEM_ID + + +# ============================================================ +# README Sample: Create STAC Collection (lifecycle test) +# ============================================================ +def test_create_collection_lifecycle(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.planetarycomputer.models import ( + StacCollection, + StacExtensionSpatialExtent, + StacCollectionTemporalExtent, + StacExtensionExtent, + RenderOption, + TileSettings, + ) + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + test_collection_id = "readme-validation-test" + + # Cleanup if leftover from previous run + try: + client.stac.get_collection(collection_id=test_collection_id) + print(f" Cleaning up leftover collection '{test_collection_id}'...") + client.stac.begin_delete_collection(collection_id=test_collection_id).result() + except ResourceNotFoundError: + pass + + # --- Create collection (from README) --- + collection = StacCollection( + id=test_collection_id, + description="A collection of geospatial data", + license="proprietary", + extent=StacExtensionExtent( + spatial=StacExtensionSpatialExtent(bounding_box=[[-180.0, -90.0, 180.0, 90.0]]), + temporal=StacCollectionTemporalExtent(interval=[[None, None]]), + ), + links=[], + stac_version="1.0.0", + type="Collection", + ) + + poller = client.stac.begin_create_collection(body=collection) + poller.result() + print(f" Created collection: {test_collection_id}") + + # Verify it exists + created = client.stac.get_collection(collection_id=test_collection_id) + assert created.id == test_collection_id + + # --- Configure visualization (from README) --- + render_option = RenderOption( + id="true-color", + name="True Color", + type="raster-tile", + options="assets=image&rescale=0,255", + ) + client.stac.create_render_option(collection_id=test_collection_id, body=render_option) + print(" Created render option") + + tile_settings = TileSettings(min_zoom=6, max_items_per_tile=10) + client.stac.replace_tile_settings(collection_id=test_collection_id, body=tile_settings) + print(" Updated tile settings") + + for option in client.stac.list_render_options(collection_id=test_collection_id): + print(f" Render option: {option.id} - {option.name}") + + # --- Cleanup --- + client.stac.begin_delete_collection(collection_id=test_collection_id).result() + print(f" Deleted collection: {test_collection_id}") + + +# ============================================================ +# README Sample: Register and Render Mosaic Tiles +# ============================================================ +def test_register_mosaic(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + registration = client.data.register_mosaics_search( + body={ + "collections": [COLLECTION_ID], + "filter-lang": "cql2-json", + "filter": {"op": "=", "args": [{"property": "naip:year"}, "2021"]}, + } + ) + print(f"Search ID: {registration.search_id}") + assert registration.search_id is not None + + tile_json = client.data.get_searches_tile_json( + search_id=registration.search_id, + tile_matrix_set_id="WebMercatorQuad", + assets=["image"], + ) + print(f"Tile URLs: {tile_json.tiles}") + print(f"Bounds: {tile_json.bounds}") + assert tile_json.tiles is not None + + +# ============================================================ +# README Sample: Extract Point Values +# ============================================================ +def test_extract_point(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + point_data = client.data.get_item_point( + collection_id=COLLECTION_ID, + item_id=ITEM_ID, + longitude=-84.41, + latitude=33.65, + assets=["image"], + ) + + print(f"Coordinates: {point_data.coordinates}") + print(f"Band names: {point_data.band_names}") + print(f"Values: {point_data.values_property}") + assert point_data.coordinates is not None + + +# ============================================================ +# README Sample: Generate Map Tiles +# ============================================================ +def test_generate_tile(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + tile_response = client.data.get_tile( + collection_id=COLLECTION_ID, + item_id=ITEM_ID, + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4322, + y=6463, + assets=["image"], + format="png", + ) + + tile_bytes = b"".join(tile_response) + print(f"Tile size: {len(tile_bytes)} bytes") + assert len(tile_bytes) > 0, "Tile response was empty" + + +# ============================================================ +# README Sample: Generate SAS Token +# ============================================================ +def test_sas_token(): + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + token_response = client.sas.get_token( + collection_id=COLLECTION_ID, + duration_in_minutes=60, + ) + + print(f"SAS Token: {token_response.token[:50]}...") + print(f"Expiry: {token_response.expires_on}") + assert token_response.token is not None + + +# ============================================================ +# README Sample: Async Operations +# ============================================================ +def test_async_operations(): + from azure.planetarycomputer.aio import PlanetaryComputerProClient as AsyncClient + from azure.identity.aio import DefaultAzureCredential as AsyncCredential + + async def _run(): + credential = AsyncCredential() + async with AsyncClient(endpoint=ENDPOINT, credential=credential) as client: + collections_response = await client.stac.get_collections(headers={"Accept-Encoding": "identity"}) + for collection in collections_response.collections: + print(f" Async Collection: {collection.id}") + break + + item = await client.stac.get_item( + collection_id=COLLECTION_ID, + item_id=ITEM_ID, + ) + print(f" Async Item: {item.id}") + assert item.id == ITEM_ID + + await credential.close() + + asyncio.run(_run()) + + +# ============================================================ +# README Sample: Error Handling +# ============================================================ +def test_error_handling(): + from azure.core.exceptions import HttpResponseError + from azure.planetarycomputer import PlanetaryComputerProClient + from azure.identity import DefaultAzureCredential + + client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) + + try: + client.stac.get_collection(collection_id="non-existent-collection") + assert False, "Should have raised HttpResponseError" + except HttpResponseError as e: + print(f"Status code: {e.status_code}") + print(f"Reason: {e.reason}") + assert e.status_code == 404 + + +# ============================================================ +# Run all samples +# ============================================================ +def main(): + print(f"Validating README samples against: {ENDPOINT}\n") + + run_sample("List STAC Collections", test_list_collections) + run_sample("Search for STAC Items", test_search_items) + run_sample("Get STAC Item Details", test_get_item) + run_sample("Create Collection Lifecycle", test_create_collection_lifecycle) + run_sample("Register and Render Mosaic Tiles", test_register_mosaic) + run_sample("Extract Point Values", test_extract_point) + run_sample("Generate Map Tiles", test_generate_tile) + run_sample("Generate SAS Token", test_sas_token) + run_sample("Async Operations", test_async_operations) + run_sample("Error Handling", test_error_handling) + + # Summary + print(f"\n{'='*60}") + print("SUMMARY") + print(f"{'='*60}") + passed = sum(1 for _, s, _ in results if s == "PASS") + failed = sum(1 for _, s, _ in results if s == "FAIL") + for name, status, err in results: + icon = "✅" if status == "PASS" else "❌" + line = f" {icon} {name}" + if err: + line += f" — {err[:80]}" + print(line) + print(f"\n{passed}/{passed + failed} passed") + + if failed: + exit(1) + + +if __name__ == "__main__": + main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py index 42570444fe5d..c2532a93b240 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py @@ -42,12 +42,8 @@ def add_sanitizers(test_proxy): planetarycomputer_subscription_id = os.environ.get( "PLANETARYCOMPUTER_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" ) - planetarycomputer_tenant_id = os.environ.get( - "PLANETARYCOMPUTER_TENANT_ID", "00000000-0000-0000-0000-000000000000" - ) - planetarycomputer_client_id = os.environ.get( - "PLANETARYCOMPUTER_CLIENT_ID", "00000000-0000-0000-0000-000000000000" - ) + planetarycomputer_tenant_id = os.environ.get("PLANETARYCOMPUTER_TENANT_ID", "00000000-0000-0000-0000-000000000000") + planetarycomputer_client_id = os.environ.get("PLANETARYCOMPUTER_CLIENT_ID", "00000000-0000-0000-0000-000000000000") planetarycomputer_client_secret = os.environ.get( "PLANETARYCOMPUTER_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" ) @@ -55,12 +51,8 @@ def add_sanitizers(test_proxy): regex=planetarycomputer_subscription_id, value="00000000-0000-0000-0000-000000000000", ) - add_general_regex_sanitizer( - regex=planetarycomputer_tenant_id, value="00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer( - regex=planetarycomputer_client_id, value="00000000-0000-0000-0000-000000000000" - ) + add_general_regex_sanitizer(regex=planetarycomputer_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=planetarycomputer_client_id, value="00000000-0000-0000-0000-000000000000") add_general_regex_sanitizer( regex=planetarycomputer_client_secret, value="00000000-0000-0000-0000-000000000000", @@ -71,9 +63,7 @@ def add_sanitizers(test_proxy): add_body_key_sanitizer(json_path="$..access_token", value="access_token") # Sanitize request tracking headers - add_header_regex_sanitizer( - key="X-Request-ID", value="00000000000000000000000000000000" - ) + add_header_regex_sanitizer(key="X-Request-ID", value="00000000000000000000000000000000") add_header_regex_sanitizer(key="Date", value="Mon, 01 Jan 2024 00:00:00 GMT") add_header_regex_sanitizer(key="Server-Timing", value="total;dur=0.0") add_header_regex_sanitizer( @@ -82,9 +72,7 @@ def add_sanitizers(test_proxy): ) # Note: Removed Content-Length sanitizer as it was causing matching issues with DELETE requests # add_header_regex_sanitizer(key="Content-Length", value="100000") - add_header_regex_sanitizer( - key="mise-correlation-id", value="00000000-0000-0000-0000-000000000000" - ) + add_header_regex_sanitizer(key="mise-correlation-id", value="00000000-0000-0000-0000-000000000000") # Sanitize the endpoint hostname to match the test proxy's format from devtools_testutils import add_uri_regex_sanitizer, add_general_string_sanitizer @@ -98,9 +86,7 @@ def add_sanitizers(test_proxy): regex=r"https?://[a-zA-Z0-9\-\.]+\.geocatalog\.[a-zA-Z0-9\-\.]+\.azure\.com", value=fake_endpoint, ) - add_uri_regex_sanitizer( - regex=r"https?://[a-zA-Z0-9\-\.]+\.geocatalog\.azure\.com", value=fake_endpoint - ) + add_uri_regex_sanitizer(regex=r"https?://[a-zA-Z0-9\-\.]+\.geocatalog\.azure\.com", value=fake_endpoint) # In live mode, also add a string sanitizer for the real endpoint value # This ensures that the EnvironmentVariableLoader's auto-sanitizer uses our fake value @@ -137,9 +123,7 @@ def add_sanitizers(test_proxy): ]: real_container_url = os.environ.get(env_var, "") if real_container_url: - add_general_string_sanitizer( - target=real_container_url, value=fake_container_url - ) + add_general_string_sanitizer(target=real_container_url, value=fake_container_url) # Sanitize storage account URLs WITH URL-encoded protocol prefix (e.g., in query parameters) # Matches: https%3A%2F%2Fcontosdatasa.blob.core.windows.net → https%3A%2F%2FSANITIZED.blob.core.windows.net @@ -256,17 +240,13 @@ def add_sanitizers(test_proxy): # Pattern: naip-atl-bde3e846 -> naip-atl-00000000 # The service appends a random 8-character hex hash to collection IDs at runtime # The env var may be "naip-atl" but the service will return "naip-atl-bde3e846" - planetarycomputer_collection_id = os.environ.get( - "PLANETARYCOMPUTER_COLLECTION_ID", "naip-atl" - ) + planetarycomputer_collection_id = os.environ.get("PLANETARYCOMPUTER_COLLECTION_ID", "naip-atl") # ALWAYS sanitize any collection ID with hash suffix pattern # We use the base collection name from env var (which may or may not already have a hash) import re - collection_base_match = re.match( - r"^(.+)-[a-f0-9]{8}$", planetarycomputer_collection_id - ) + collection_base_match = re.match(r"^(.+)-[a-f0-9]{8}$", planetarycomputer_collection_id) if collection_base_match: # Env var already has hash: use the base part collection_base = collection_base_match.group(1) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py index a3f89ed363e5..33e43ef46f96 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py @@ -15,6 +15,7 @@ from pathlib import Path from devtools_testutils import recorded_by_proxy, is_live from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerPreparer +from azure.core.exceptions import ResourceNotFoundError from azure.planetarycomputer.models import ( PartitionTypeScheme, ) @@ -63,14 +64,10 @@ def test_01_list_collections(self, planetarycomputer_endpoint): # Validate response structure assert response is not None, "Response should not be None" - assert hasattr( - response, "collections" - ), "Response should have 'collections' attribute" + assert hasattr(response, "collections"), "Response should have 'collections' attribute" collections = response.collections - assert isinstance( - collections, list - ), f"Collections should be a list, got {type(collections)}" + assert isinstance(collections, list), f"Collections should be a list, got {type(collections)}" test_logger.info(f"Number of collections: {len(collections)}") @@ -108,14 +105,10 @@ def test_02_get_conformance_class(self, planetarycomputer_endpoint): # Validate response structure assert response is not None, "Response should not be None" - assert hasattr( - response, "conforms_to" - ), "Response should have 'conforms_to' attribute" + assert hasattr(response, "conforms_to"), "Response should have 'conforms_to' attribute" conforms_to = response.conforms_to - assert isinstance( - conforms_to, list - ), f"conformsTo should be a list, got {type(conforms_to)}" + assert isinstance(conforms_to, list), f"conformsTo should be a list, got {type(conforms_to)}" assert len(conforms_to) > 0, "Should have at least one conformance class" test_logger.info(f"Number of conformance classes: {len(conforms_to)}") @@ -126,9 +119,7 @@ def test_02_get_conformance_class(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_03_get_collection( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_03_get_collection(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific STAC collection. @@ -144,12 +135,8 @@ def test_03_get_collection( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_collection(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.get_collection(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Collection ID: {response.id}") @@ -158,12 +145,8 @@ def test_03_get_collection( # Validate response structure assert response is not None, "Response should not be None" - assert ( - response.id == planetarycomputer_collection_id - ), "Collection ID should match requested ID" - assert ( - response.title is not None and len(response.title) > 0 - ), "Collection should have a title" + assert response.id == planetarycomputer_collection_id, "Collection ID should match requested ID" + assert response.title is not None and len(response.title) > 0, "Collection should have a title" assert response.description is not None, "Collection should have a description" assert response.extent is not None, "Collection should have extent" assert response.license is not None, "Collection should have license" @@ -172,9 +155,7 @@ def test_03_get_collection( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_04_get_partition_type( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_04_get_partition_type(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting partition type for a collection. @@ -190,9 +171,7 @@ def test_04_get_partition_type( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_partition_type(collection_id='{planetarycomputer_collection_id}')" - ) + test_logger.info(f"Calling: get_partition_type(collection_id='{planetarycomputer_collection_id}')") response = client.stac.get_partition_type(planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") @@ -205,17 +184,13 @@ def test_04_get_partition_type( # Validate scheme is a valid PartitionTypeScheme valid_schemes = [s.value for s in PartitionTypeScheme] - assert ( - response.scheme in valid_schemes - ), f"Partition scheme should be one of {valid_schemes}" + assert response.scheme in valid_schemes, f"Partition scheme should be one of {valid_schemes}" test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_05_list_render_options( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_05_list_render_options(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test listing render options for a collection. @@ -231,20 +206,14 @@ def test_05_list_render_options( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: list_render_options(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.list_render_options( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: list_render_options(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.list_render_options(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Number of render options: {len(response)}") # Validate response structure - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" if len(response) > 0: first_option = response[0] @@ -260,9 +229,7 @@ def test_05_list_render_options( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_06_get_tile_settings( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_06_get_tile_settings(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting tile settings for a collection. @@ -278,12 +245,8 @@ def test_06_get_tile_settings( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_tile_settings(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.get_tile_settings( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_tile_settings(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.get_tile_settings(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): @@ -305,9 +268,7 @@ def test_06_get_tile_settings( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_07_list_mosaics( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_07_list_mosaics(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test listing mosaics for a collection. @@ -323,20 +284,14 @@ def test_07_list_mosaics( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: list_mosaics(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.list_mosaics( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: list_mosaics(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.list_mosaics(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Number of mosaics: {len(response)}") # Validate response structure - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" if len(response) > 0: first_mosaic = response[0] @@ -350,9 +305,7 @@ def test_07_list_mosaics( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_08_get_collection_queryables( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_08_get_collection_queryables(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting queryables for a collection. @@ -368,17 +321,11 @@ def test_08_get_collection_queryables( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_collection_queryables(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection_queryables(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") - test_logger.info( - f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}" - ) + test_logger.info(f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}") # Validate response structure assert isinstance(response, MutableMapping), f"Response should be a dict, got {type(response)}" @@ -415,9 +362,7 @@ def test_09_list_queryables(self, planetarycomputer_endpoint): response = client.stac.list_queryables() test_logger.info(f"Response type: {type(response)}") - test_logger.info( - f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}" - ) + test_logger.info(f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}") # Validate response structure assert isinstance(response, MutableMapping), f"Response should be a dict, got {type(response)}" @@ -430,9 +375,7 @@ def test_09_list_queryables(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_10_get_collection_configuration( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_10_get_collection_configuration(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting collection configuration. @@ -448,12 +391,8 @@ def test_10_get_collection_configuration( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_collection_configuration(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.get_collection_configuration( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection_configuration(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.get_collection_configuration(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): @@ -467,9 +406,7 @@ def test_10_get_collection_configuration( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_10a_create_thumbnail_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_10a_create_thumbnail_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating a thumbnail collection asset. This ensures the collection has a thumbnail for subsequent tests. @@ -487,22 +424,12 @@ def test_10a_create_thumbnail_asset( # Delete the thumbnail asset if it already exists try: - test_logger.info( - "Checking if asset 'thumbnail' already exists and deleting if found..." - ) - client.stac.delete_collection_asset( - collection_id=planetarycomputer_collection_id, asset_id="thumbnail" - ) + test_logger.info("Checking if asset 'thumbnail' already exists and deleting if found...") + client.stac.delete_collection_asset(collection_id=planetarycomputer_collection_id, asset_id="thumbnail") test_logger.info("Deleted existing 'thumbnail'") except Exception as e: - if ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ): - test_logger.info( - "Asset 'thumbnail' does not exist, proceeding with creation" - ) + if "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower(): + test_logger.info("Asset 'thumbnail' does not exist, proceeding with creation") else: test_logger.warning(f"Error checking/deleting asset: {e}") @@ -516,8 +443,7 @@ def test_10a_create_thumbnail_asset( # Minimal valid 16x9 RGB PNG image png_bytes = base64.b64decode( - "iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAIAAAC0SDtlAAAAEklEQVR4nGNg" - "aGAgDY1qGBQaAAlbSAENQjjgAAAAAElFTkSuQmCC" + "iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAIAAAC0SDtlAAAAEklEQVR4nGNg" "aGAgDY1qGBQaAAlbSAENQjjgAAAAAElFTkSuQmCC" ) file_content = BytesIO(png_bytes) @@ -535,18 +461,14 @@ def test_10a_create_thumbnail_asset( assert response is not None # Verify the thumbnail asset now exists on the collection - collection = client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert "thumbnail" in collection.assets, "Collection should now have a thumbnail asset" test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_11_get_collection_thumbnail( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_11_get_collection_thumbnail(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting collection thumbnail. @@ -563,23 +485,13 @@ def test_11_get_collection_thumbnail( client = self.create_client(endpoint=planetarycomputer_endpoint) # First check if collection has thumbnail asset - collection = client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = client.stac.get_collection(collection_id=planetarycomputer_collection_id) - if ( - not hasattr(collection, "assets") - or collection.assets is None - or "thumbnail" not in collection.assets - ): + if not hasattr(collection, "assets") or collection.assets is None or "thumbnail" not in collection.assets: assert False, "Collection does not have a thumbnail asset" - test_logger.info( - f"Calling: get_collection_thumbnail(collection_id='{planetarycomputer_collection_id}')" - ) - response = client.stac.get_collection_thumbnail( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection_thumbnail(collection_id='{planetarycomputer_collection_id}')") + response = client.stac.get_collection_thumbnail(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") @@ -590,9 +502,7 @@ def test_11_get_collection_thumbnail( # Validate image data assert len(thumbnail_bytes) > 0, "Thumbnail bytes should not be empty" - assert ( - len(thumbnail_bytes) > 50 - ), f"Thumbnail should be substantial, got only {len(thumbnail_bytes)} bytes" + assert len(thumbnail_bytes) > 50, f"Thumbnail should be substantial, got only {len(thumbnail_bytes)} bytes" # Check for common image format magic bytes # PNG: 89 50 4E 47 @@ -611,9 +521,7 @@ def test_11_get_collection_thumbnail( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_12_create_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_12_create_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating a render option for a collection. """ @@ -631,9 +539,7 @@ def test_12_create_render_option( collection_id=planetarycomputer_collection_id, render_option_id="test-natural-color", ) - test_logger.info( - "Render option 'test-natural-color' already exists, deleting it first" - ) + test_logger.info("Render option 'test-natural-color' already exists, deleting it first") client.stac.delete_render_option( collection_id=planetarycomputer_collection_id, render_option_id="test-natural-color", @@ -653,9 +559,7 @@ def test_12_create_render_option( test_logger.info( f"Calling: create_render_option(collection_id='{planetarycomputer_collection_id}', body={render_option})" ) - response = client.stac.create_render_option( - collection_id=planetarycomputer_collection_id, body=render_option - ) + response = client.stac.create_render_option(collection_id=planetarycomputer_collection_id, body=render_option) test_logger.info(f"Response: {response}") assert response is not None @@ -666,9 +570,7 @@ def test_12_create_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_13_get_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_13_get_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific render option. """ @@ -695,9 +597,7 @@ def test_13_get_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_14_replace_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_14_replace_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a render option. """ @@ -736,9 +636,7 @@ def test_14_replace_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_14a_delete_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_14a_delete_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a render option. First creates a render option specifically for deletion. @@ -761,9 +659,7 @@ def test_14a_delete_render_option( ) test_logger.info(f"Creating render option for deletion: {render_option.id}") - client.stac.create_render_option( - collection_id=planetarycomputer_collection_id, body=render_option - ) + client.stac.create_render_option(collection_id=planetarycomputer_collection_id, body=render_option) # Verify it exists retrieved = client.stac.get_render_option( @@ -793,19 +689,13 @@ def test_14a_delete_render_option( assert False, "Render option should have been deleted" except Exception as e: test_logger.info(f"Confirmed deletion (404 expected): {e}") - assert ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ) + assert "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower() test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_15_add_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_15_add_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test adding a mosaic to a collection. """ @@ -819,13 +709,9 @@ def test_15_add_mosaic( # Check if mosaic already exists and delete it try: - client.stac.get_mosaic( - collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1" - ) + client.stac.get_mosaic(collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1") test_logger.info("Mosaic 'test-mosaic-1' already exists, deleting it first") - client.stac.delete_mosaic( - collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1" - ) + client.stac.delete_mosaic(collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1") test_logger.info("Existing mosaic deleted") except Exception as e: test_logger.info(f"Mosaic does not exist (expected): {e}") @@ -836,12 +722,8 @@ def test_15_add_mosaic( cql=[], ) - test_logger.info( - f"Calling: add_mosaic(collection_id='{planetarycomputer_collection_id}', body={mosaic})" - ) - response = client.stac.add_mosaic( - collection_id=planetarycomputer_collection_id, body=mosaic - ) + test_logger.info(f"Calling: add_mosaic(collection_id='{planetarycomputer_collection_id}', body={mosaic})") + response = client.stac.add_mosaic(collection_id=planetarycomputer_collection_id, body=mosaic) test_logger.info(f"Response: {response}") assert response is not None @@ -852,9 +734,7 @@ def test_15_add_mosaic( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_16_get_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_16_get_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific mosaic. """ @@ -867,9 +747,7 @@ def test_16_get_mosaic( test_logger.info( f"Calling: get_mosaic(collection_id='{planetarycomputer_collection_id}', mosaic_id='test-mosaic-1')" ) - response = client.stac.get_mosaic( - collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1" - ) + response = client.stac.get_mosaic(collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1") test_logger.info(f"Response: {response}") assert response is not None @@ -880,9 +758,7 @@ def test_16_get_mosaic( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_17_replace_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_17_replace_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a mosaic. """ @@ -919,9 +795,7 @@ def test_17_replace_mosaic( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_17a_delete_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_17a_delete_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a mosaic. First creates a mosaic specifically for deletion. @@ -942,9 +816,7 @@ def test_17a_delete_mosaic( ) test_logger.info(f"Creating mosaic for deletion: {mosaic.id}") - client.stac.add_mosaic( - collection_id=planetarycomputer_collection_id, body=mosaic - ) + client.stac.add_mosaic(collection_id=planetarycomputer_collection_id, body=mosaic) # Verify it exists retrieved = client.stac.get_mosaic( @@ -974,11 +846,7 @@ def test_17a_delete_mosaic( assert False, "Mosaic should have been deleted" except Exception as e: test_logger.info(f"Confirmed deletion (404 expected): {e}") - assert ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ) + assert "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower() test_logger.info("Test PASSED\n") @@ -1008,22 +876,21 @@ def test_18_replace_partition_type(self, planetarycomputer_endpoint): # Check if collection exists and delete it first try: - existing_collection = client.stac.get_collection( - collection_id=test_collection_id - ) + existing_collection = client.stac.get_collection(collection_id=test_collection_id) if existing_collection: - test_logger.info( - f"Collection '{test_collection_id}' already exists, deleting first..." - ) - delete_poller = client.stac.begin_delete_collection( - collection_id=test_collection_id, polling=True - ) + test_logger.info(f"Collection '{test_collection_id}' already exists, deleting first...") + delete_poller = client.stac.begin_delete_collection(collection_id=test_collection_id, polling=True) delete_poller.result() test_logger.info(f"Deleted existing collection '{test_collection_id}'") - except Exception: - test_logger.info( - f"Collection '{test_collection_id}' does not exist, proceeding with creation" - ) + # Wait for deletion to fully propagate + for _ in range(12): + try: + client.stac.get_collection(collection_id=test_collection_id) + time.sleep(5) + except ResourceNotFoundError: + break + except ResourceNotFoundError: + test_logger.info(f"Collection '{test_collection_id}' does not exist, proceeding with creation") # Define collection extents spatial_extent = StacExtensionSpatialExtent(bounding_box=[[-180, -90, 180, 90]]) @@ -1050,13 +917,20 @@ def test_18_replace_partition_type(self, planetarycomputer_endpoint): "type": "Collection", } - # Create the collection using the correct API + # Create the collection, retrying if previous deletion hasn't fully propagated + from azure.core.exceptions import ResourceExistsError test_logger.info("Creating collection using begin_create_collection") - create_poller = client.stac.begin_create_collection( - body=collection_data, polling=True - ) - create_poller.result() - test_logger.info("Temporary collection created") + for attempt in range(12): + try: + create_poller = client.stac.begin_create_collection(body=collection_data, polling=True) + create_poller.result() + test_logger.info("Temporary collection created") + break + except ResourceExistsError: + test_logger.info(f"Collection still being deleted, retrying in 5s (attempt {attempt + 1}/12)") + time.sleep(5) + else: + raise RuntimeError("Failed to create collection after 12 retries - previous deletion still pending") try: # Set partition type @@ -1065,9 +939,7 @@ def test_18_replace_partition_type(self, planetarycomputer_endpoint): test_logger.info( f"Calling: replace_partition_type(collection_id='{test_collection_id}', body={partition_type})" ) - client.stac.replace_partition_type( - collection_id=test_collection_id, body=partition_type - ) + client.stac.replace_partition_type(collection_id=test_collection_id, body=partition_type) # Verify the change updated_partition = client.stac.get_partition_type(test_collection_id) @@ -1079,9 +951,7 @@ def test_18_replace_partition_type(self, planetarycomputer_endpoint): # Clean up: delete the temporary collection test_logger.info(f"Deleting temporary collection: {test_collection_id}") try: - delete_poller = client.stac.begin_delete_collection( - collection_id=test_collection_id, polling=True - ) + delete_poller = client.stac.begin_delete_collection(collection_id=test_collection_id, polling=True) delete_poller.result() test_logger.info("Temporary collection deleted") except Exception as e: @@ -1091,9 +961,7 @@ def test_18_replace_partition_type(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_19_replace_tile_settings( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_19_replace_tile_settings(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test replacing tile settings for a collection. """ @@ -1114,9 +982,7 @@ def test_19_replace_tile_settings( test_logger.info( f"Calling: replace_tile_settings(collection_id='{planetarycomputer_collection_id}', body={tile_settings})" ) - response = client.stac.replace_tile_settings( - collection_id=planetarycomputer_collection_id, body=tile_settings - ) + response = client.stac.replace_tile_settings(collection_id=planetarycomputer_collection_id, body=tile_settings) test_logger.info(f"Response: {response}") assert response is not None @@ -1127,9 +993,7 @@ def test_19_replace_tile_settings( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_20_create_queryables( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_20_create_queryables(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating queryables for a collection. """ @@ -1146,13 +1010,9 @@ def test_20_create_queryables( # Check if queryable already exists and delete it try: - queryables = client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) + queryables = client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) if "test:property" in queryables.get("properties", {}): - test_logger.info( - "Queryable 'test:property' already exists, deleting it first" - ) + test_logger.info("Queryable 'test:property' already exists, deleting it first") client.stac.delete_queryable( collection_id=planetarycomputer_collection_id, queryable_name="test:property", @@ -1175,34 +1035,24 @@ def test_20_create_queryables( test_logger.info( f"Calling: create_queryables(collection_id='{planetarycomputer_collection_id}', body=[queryable])" ) - response = client.stac.create_queryables( - collection_id=planetarycomputer_collection_id, body=[queryable] - ) + response = client.stac.create_queryables(collection_id=planetarycomputer_collection_id, body=[queryable]) test_logger.info(f"Response: {response}") assert response is not None # Response is a list of queryables - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Response should contain at least one queryable" # Verify our queryable was created - queryable_names = [ - q.get("name") if isinstance(q, MutableMapping) else q.name for q in response - ] - assert ( - "test:property" in queryable_names - ), "Created queryable 'test:property' should be in response" + queryable_names = [q.get("name") if isinstance(q, MutableMapping) else q.name for q in response] + assert "test:property" in queryable_names, "Created queryable 'test:property' should be in response" test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_21_replace_queryable( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_21_replace_queryable(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a queryable. """ @@ -1242,9 +1092,7 @@ def test_21_replace_queryable( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_21a_delete_queryable( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_21a_delete_queryable(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a queryable. First creates a queryable specifically for deletion. @@ -1271,14 +1119,10 @@ def test_21a_delete_queryable( ) test_logger.info(f"Creating queryable for deletion: {queryable.name}") - client.stac.create_queryables( - collection_id=planetarycomputer_collection_id, body=[queryable] - ) + client.stac.create_queryables(collection_id=planetarycomputer_collection_id, body=[queryable]) # Verify it exists - queryables = client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) + queryables = client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) assert "test:property_to_be_deleted" in queryables["properties"] test_logger.info("Queryable created successfully") @@ -1294,11 +1138,7 @@ def test_21a_delete_queryable( test_logger.info("Queryable deleted successfully") # Verify deletion - queryables_after = client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) - assert ( - "test:property_to_be_deleted" not in queryables_after["properties"] - ), "Queryable should have been deleted" + queryables_after = client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) + assert "test:property_to_be_deleted" not in queryables_after["properties"], "Queryable should have been deleted" test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py index 77011a186057..91e078e6c72f 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py @@ -17,6 +17,7 @@ from devtools_testutils import recorded_by_proxy, is_live from testpreparer_async import PlanetaryComputerProClientTestBaseAsync from testpreparer import PlanetaryComputerPreparer +from azure.core.exceptions import ResourceNotFoundError from azure.planetarycomputer.models import ( PartitionTypeScheme, ) @@ -65,14 +66,10 @@ async def test_01_list_collections(self, planetarycomputer_endpoint): # Validate response structure assert response is not None, "Response should not be None" - assert hasattr( - response, "collections" - ), "Response should have 'collections' attribute" + assert hasattr(response, "collections"), "Response should have 'collections' attribute" collections = response.collections - assert isinstance( - collections, list - ), f"Collections should be a list, got {type(collections)}" + assert isinstance(collections, list), f"Collections should be a list, got {type(collections)}" test_logger.info(f"Number of collections: {len(collections)}") @@ -112,14 +109,10 @@ async def test_02_get_conformance_class(self, planetarycomputer_endpoint): # Validate response structure assert response is not None, "Response should not be None" - assert hasattr( - response, "conforms_to" - ), "Response should have 'conforms_to' attribute" + assert hasattr(response, "conforms_to"), "Response should have 'conforms_to' attribute" conforms_to = response.conforms_to - assert isinstance( - conforms_to, list - ), f"conformsTo should be a list, got {type(conforms_to)}" + assert isinstance(conforms_to, list), f"conformsTo should be a list, got {type(conforms_to)}" assert len(conforms_to) > 0, "Should have at least one conformance class" test_logger.info(f"Number of conformance classes: {len(conforms_to)}") @@ -132,9 +125,7 @@ async def test_02_get_conformance_class(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_03_get_collection( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_03_get_collection(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific STAC collection. @@ -150,12 +141,8 @@ async def test_03_get_collection( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_collection(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Collection ID: {response.id}") @@ -164,12 +151,8 @@ async def test_03_get_collection( # Validate response structure assert response is not None, "Response should not be None" - assert ( - response.id == planetarycomputer_collection_id - ), "Collection ID should match requested ID" - assert ( - response.title is not None and len(response.title) > 0 - ), "Collection should have a title" + assert response.id == planetarycomputer_collection_id, "Collection ID should match requested ID" + assert response.title is not None and len(response.title) > 0, "Collection should have a title" assert response.description is not None, "Collection should have a description" assert response.extent is not None, "Collection should have extent" assert response.license is not None, "Collection should have license" @@ -180,9 +163,7 @@ async def test_03_get_collection( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_04_get_partition_type( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_04_get_partition_type(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting partition type for a collection. @@ -198,9 +179,7 @@ async def test_04_get_partition_type( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_partition_type(collection_id='{planetarycomputer_collection_id}')" - ) + test_logger.info(f"Calling: get_partition_type(collection_id='{planetarycomputer_collection_id}')") response = await client.stac.get_partition_type(planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") @@ -213,9 +192,7 @@ async def test_04_get_partition_type( # Validate scheme is a valid PartitionTypeScheme valid_schemes = [s.value for s in PartitionTypeScheme] - assert ( - response.scheme in valid_schemes - ), f"Partition scheme should be one of {valid_schemes}" + assert response.scheme in valid_schemes, f"Partition scheme should be one of {valid_schemes}" test_logger.info("Test PASSED\n") @@ -223,9 +200,7 @@ async def test_04_get_partition_type( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_05_list_render_options( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_05_list_render_options(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test listing render options for a collection. @@ -241,20 +216,14 @@ async def test_05_list_render_options( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: list_render_options(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.list_render_options( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: list_render_options(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.list_render_options(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Number of render options: {len(response)}") # Validate response structure - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" if len(response) > 0: first_option = response[0] @@ -272,9 +241,7 @@ async def test_05_list_render_options( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_06_get_tile_settings( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_06_get_tile_settings(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting tile settings for a collection. @@ -290,12 +257,8 @@ async def test_06_get_tile_settings( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_tile_settings(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.get_tile_settings( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_tile_settings(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.get_tile_settings(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): @@ -319,9 +282,7 @@ async def test_06_get_tile_settings( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_07_list_mosaics( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_07_list_mosaics(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test listing mosaics for a collection. @@ -337,20 +298,14 @@ async def test_07_list_mosaics( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: list_mosaics(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.list_mosaics( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: list_mosaics(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.list_mosaics(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Number of mosaics: {len(response)}") # Validate response structure - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" if len(response) > 0: first_mosaic = response[0] @@ -366,9 +321,7 @@ async def test_07_list_mosaics( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_08_get_collection_queryables( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_08_get_collection_queryables(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting queryables for a collection. @@ -384,17 +337,11 @@ async def test_08_get_collection_queryables( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_collection_queryables(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection_queryables(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") - test_logger.info( - f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}" - ) + test_logger.info(f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}") # Validate response structure assert isinstance(response, MutableMapping), f"Response should be a dict, got {type(response)}" @@ -433,9 +380,7 @@ async def test_09_list_queryables(self, planetarycomputer_endpoint): response = await client.stac.list_queryables() test_logger.info(f"Response type: {type(response)}") - test_logger.info( - f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}" - ) + test_logger.info(f"Response keys: {list(response.keys()) if isinstance(response, MutableMapping) else 'N/A'}") # Validate response structure assert isinstance(response, MutableMapping), f"Response should be a dict, got {type(response)}" @@ -450,9 +395,7 @@ async def test_09_list_queryables(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_10_get_collection_configuration( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_10_get_collection_configuration(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting collection configuration. @@ -468,12 +411,8 @@ async def test_10_get_collection_configuration( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_collection_configuration(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.get_collection_configuration( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection_configuration(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.get_collection_configuration(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): @@ -489,9 +428,7 @@ async def test_10_get_collection_configuration( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_10a_create_thumbnail_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_10a_create_thumbnail_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating a thumbnail collection asset. This ensures the collection has a thumbnail for subsequent tests. @@ -509,22 +446,14 @@ async def test_10a_create_thumbnail_asset( # Delete the thumbnail asset if it already exists try: - test_logger.info( - "Checking if asset 'thumbnail' already exists and deleting if found..." - ) + test_logger.info("Checking if asset 'thumbnail' already exists and deleting if found...") await client.stac.delete_collection_asset( collection_id=planetarycomputer_collection_id, asset_id="thumbnail" ) test_logger.info("Deleted existing 'thumbnail'") except Exception as e: - if ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ): - test_logger.info( - "Asset 'thumbnail' does not exist, proceeding with creation" - ) + if "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower(): + test_logger.info("Asset 'thumbnail' does not exist, proceeding with creation") else: test_logger.warning(f"Error checking/deleting asset: {e}") @@ -538,8 +467,7 @@ async def test_10a_create_thumbnail_asset( # Minimal valid 16x9 RGB PNG image png_bytes = base64.b64decode( - "iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAIAAAC0SDtlAAAAEklEQVR4nGNg" - "aGAgDY1qGBQaAAlbSAENQjjgAAAAAElFTkSuQmCC" + "iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAIAAAC0SDtlAAAAEklEQVR4nGNg" "aGAgDY1qGBQaAAlbSAENQjjgAAAAAElFTkSuQmCC" ) file_content = BytesIO(png_bytes) @@ -557,9 +485,7 @@ async def test_10a_create_thumbnail_asset( assert response is not None # Verify the thumbnail asset now exists on the collection - collection = await client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert "thumbnail" in collection.assets, "Collection should now have a thumbnail asset" test_logger.info("Test PASSED\n") @@ -568,9 +494,7 @@ async def test_10a_create_thumbnail_asset( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_11_get_collection_thumbnail( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_11_get_collection_thumbnail(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting collection thumbnail. @@ -587,23 +511,13 @@ async def test_11_get_collection_thumbnail( client = self.create_client(endpoint=planetarycomputer_endpoint) # First check if collection has thumbnail asset - collection = await client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) - if ( - not hasattr(collection, "assets") - or collection.assets is None - or "thumbnail" not in collection.assets - ): + if not hasattr(collection, "assets") or collection.assets is None or "thumbnail" not in collection.assets: assert False, "Collection does not have a thumbnail asset" - test_logger.info( - f"Calling: get_collection_thumbnail(collection_id='{planetarycomputer_collection_id}')" - ) - response = await client.stac.get_collection_thumbnail( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_collection_thumbnail(collection_id='{planetarycomputer_collection_id}')") + response = await client.stac.get_collection_thumbnail(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") @@ -614,9 +528,7 @@ async def test_11_get_collection_thumbnail( # Validate image data assert len(thumbnail_bytes) > 0, "Thumbnail bytes should not be empty" - assert ( - len(thumbnail_bytes) > 50 - ), f"Thumbnail should be substantial, got only {len(thumbnail_bytes)} bytes" + assert len(thumbnail_bytes) > 50, f"Thumbnail should be substantial, got only {len(thumbnail_bytes)} bytes" # Check for common image format magic bytes # PNG: 89 50 4E 47 @@ -637,9 +549,7 @@ async def test_11_get_collection_thumbnail( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_12_create_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_12_create_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating a render option for a collection. """ @@ -657,9 +567,7 @@ async def test_12_create_render_option( collection_id=planetarycomputer_collection_id, render_option_id="test-natural-color", ) - test_logger.info( - "Render option 'test-natural-color' already exists, deleting it first" - ) + test_logger.info("Render option 'test-natural-color' already exists, deleting it first") await client.stac.delete_render_option( collection_id=planetarycomputer_collection_id, render_option_id="test-natural-color", @@ -694,9 +602,7 @@ async def test_12_create_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_13_get_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_13_get_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific render option. """ @@ -725,9 +631,7 @@ async def test_13_get_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_14_replace_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_14_replace_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a render option. """ @@ -768,9 +672,7 @@ async def test_14_replace_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_14a_delete_render_option( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_14a_delete_render_option(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a render option. First creates a render option specifically for deletion. @@ -793,9 +695,7 @@ async def test_14a_delete_render_option( ) test_logger.info(f"Creating render option for deletion: {render_option.id}") - await client.stac.create_render_option( - collection_id=planetarycomputer_collection_id, body=render_option - ) + await client.stac.create_render_option(collection_id=planetarycomputer_collection_id, body=render_option) # Verify it exists retrieved = await client.stac.get_render_option( @@ -825,11 +725,7 @@ async def test_14a_delete_render_option( assert False, "Render option should have been deleted" except Exception as e: test_logger.info(f"Confirmed deletion (404 expected): {e}") - assert ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ) + assert "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower() test_logger.info("Test PASSED\n") @@ -837,9 +733,7 @@ async def test_14a_delete_render_option( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_15_add_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_15_add_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test adding a mosaic to a collection. """ @@ -853,13 +747,9 @@ async def test_15_add_mosaic( # Check if mosaic already exists and delete it try: - await client.stac.get_mosaic( - collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1" - ) + await client.stac.get_mosaic(collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1") test_logger.info("Mosaic 'test-mosaic-1' already exists, deleting it first") - await client.stac.delete_mosaic( - collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1" - ) + await client.stac.delete_mosaic(collection_id=planetarycomputer_collection_id, mosaic_id="test-mosaic-1") test_logger.info("Existing mosaic deleted") except Exception as e: test_logger.info(f"Mosaic does not exist (expected): {e}") @@ -870,12 +760,8 @@ async def test_15_add_mosaic( cql=[], ) - test_logger.info( - f"Calling: add_mosaic(collection_id='{planetarycomputer_collection_id}', body={mosaic})" - ) - response = await client.stac.add_mosaic( - collection_id=planetarycomputer_collection_id, body=mosaic - ) + test_logger.info(f"Calling: add_mosaic(collection_id='{planetarycomputer_collection_id}', body={mosaic})") + response = await client.stac.add_mosaic(collection_id=planetarycomputer_collection_id, body=mosaic) test_logger.info(f"Response: {response}") assert response is not None @@ -888,9 +774,7 @@ async def test_15_add_mosaic( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_16_get_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_16_get_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific mosaic. """ @@ -918,9 +802,7 @@ async def test_16_get_mosaic( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_17_replace_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_17_replace_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a mosaic. """ @@ -959,9 +841,7 @@ async def test_17_replace_mosaic( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_17a_delete_mosaic( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_17a_delete_mosaic(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a mosaic. First creates a mosaic specifically for deletion. @@ -982,9 +862,7 @@ async def test_17a_delete_mosaic( ) test_logger.info(f"Creating mosaic for deletion: {mosaic.id}") - await client.stac.add_mosaic( - collection_id=planetarycomputer_collection_id, body=mosaic - ) + await client.stac.add_mosaic(collection_id=planetarycomputer_collection_id, body=mosaic) # Verify it exists retrieved = await client.stac.get_mosaic( @@ -1014,11 +892,7 @@ async def test_17a_delete_mosaic( assert False, "Mosaic should have been deleted" except Exception as e: test_logger.info(f"Confirmed deletion (404 expected): {e}") - assert ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ) + assert "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower() test_logger.info("Test PASSED\n") @@ -1050,22 +924,24 @@ async def test_18_replace_partition_type(self, planetarycomputer_endpoint): # Check if collection exists and delete it first try: - existing_collection = await client.stac.get_collection( - collection_id=test_collection_id - ) + existing_collection = await client.stac.get_collection(collection_id=test_collection_id) if existing_collection: - test_logger.info( - f"Collection '{test_collection_id}' already exists, deleting first..." - ) + test_logger.info(f"Collection '{test_collection_id}' already exists, deleting first...") delete_poller = await client.stac.begin_delete_collection( collection_id=test_collection_id, polling=True ) - delete_poller.result() + await delete_poller.result() test_logger.info(f"Deleted existing collection '{test_collection_id}'") - except Exception: - test_logger.info( - f"Collection '{test_collection_id}' does not exist, proceeding with creation" - ) + # Wait for deletion to fully propagate + import asyncio + for _ in range(12): + try: + await client.stac.get_collection(collection_id=test_collection_id) + await asyncio.sleep(5) + except ResourceNotFoundError: + break + except ResourceNotFoundError: + test_logger.info(f"Collection '{test_collection_id}' does not exist, proceeding with creation") # Define collection extents spatial_extent = StacExtensionSpatialExtent(bounding_box=[[-180, -90, 180, 90]]) @@ -1092,13 +968,21 @@ async def test_18_replace_partition_type(self, planetarycomputer_endpoint): "type": "Collection", } - # Create the collection using the correct API + # Create the collection, retrying if previous deletion hasn't fully propagated + import asyncio + from azure.core.exceptions import ResourceExistsError test_logger.info("Creating collection using begin_create_collection") - create_poller = await client.stac.begin_create_collection( - body=collection_data, polling=True - ) - await create_poller.result() - test_logger.info("Temporary collection created") + for attempt in range(12): + try: + create_poller = await client.stac.begin_create_collection(body=collection_data, polling=True) + await create_poller.result() + test_logger.info("Temporary collection created") + break + except ResourceExistsError: + test_logger.info(f"Collection still being deleted, retrying in 5s (attempt {attempt + 1}/12)") + await asyncio.sleep(5) + else: + raise RuntimeError("Failed to create collection after 12 retries - previous deletion still pending") try: # Set partition type @@ -1107,9 +991,7 @@ async def test_18_replace_partition_type(self, planetarycomputer_endpoint): test_logger.info( f"Calling: replace_partition_type(collection_id='{test_collection_id}', body={partition_type})" ) - await client.stac.replace_partition_type( - collection_id=test_collection_id, body=partition_type - ) + await client.stac.replace_partition_type(collection_id=test_collection_id, body=partition_type) # Verify the change updated_partition = await client.stac.get_partition_type(test_collection_id) @@ -1135,9 +1017,7 @@ async def test_18_replace_partition_type(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_19_replace_tile_settings( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_19_replace_tile_settings(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test replacing tile settings for a collection. """ @@ -1173,9 +1053,7 @@ async def test_19_replace_tile_settings( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_20_create_queryables( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_20_create_queryables(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating queryables for a collection. """ @@ -1192,13 +1070,9 @@ async def test_20_create_queryables( # Check if queryable already exists and delete it try: - queryables = await client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) + queryables = await client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) if "test:property" in queryables.get("properties", {}): - test_logger.info( - "Queryable 'test:property' already exists, deleting it first" - ) + test_logger.info("Queryable 'test:property' already exists, deleting it first") await client.stac.delete_queryable( collection_id=planetarycomputer_collection_id, queryable_name="test:property", @@ -1221,26 +1095,18 @@ async def test_20_create_queryables( test_logger.info( f"Calling: create_queryables(collection_id='{planetarycomputer_collection_id}', body=[queryable])" ) - response = await client.stac.create_queryables( - collection_id=planetarycomputer_collection_id, body=[queryable] - ) + response = await client.stac.create_queryables(collection_id=planetarycomputer_collection_id, body=[queryable]) test_logger.info(f"Response: {response}") assert response is not None # Response is a list of queryables - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Response should contain at least one queryable" # Verify our queryable was created - queryable_names = [ - q.get("name") if isinstance(q, MutableMapping) else q.name for q in response - ] - assert ( - "test:property" in queryable_names - ), "Created queryable 'test:property' should be in response" + queryable_names = [q.get("name") if isinstance(q, MutableMapping) else q.name for q in response] + assert "test:property" in queryable_names, "Created queryable 'test:property' should be in response" test_logger.info("Test PASSED\n") @@ -1248,9 +1114,7 @@ async def test_20_create_queryables( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_21_replace_queryable( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_21_replace_queryable(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a queryable. """ @@ -1292,9 +1156,7 @@ async def test_21_replace_queryable( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_21a_delete_queryable( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_21a_delete_queryable(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a queryable. First creates a queryable specifically for deletion. @@ -1321,14 +1183,10 @@ async def test_21a_delete_queryable( ) test_logger.info(f"Creating queryable for deletion: {queryable.name}") - await client.stac.create_queryables( - collection_id=planetarycomputer_collection_id, body=[queryable] - ) + await client.stac.create_queryables(collection_id=planetarycomputer_collection_id, body=[queryable]) # Verify it exists - queryables = await client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) + queryables = await client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) assert "test:property_to_be_deleted" in queryables["properties"] test_logger.info("Queryable created successfully") @@ -1344,12 +1202,8 @@ async def test_21a_delete_queryable( test_logger.info("Queryable deleted successfully") # Verify deletion - queryables_after = await client.stac.get_collection_queryables( - collection_id=planetarycomputer_collection_id - ) - assert ( - "test:property_to_be_deleted" not in queryables_after["properties"] - ), "Queryable should have been deleted" + queryables_after = await client.stac.get_collection_queryables(collection_id=planetarycomputer_collection_id) + assert "test:property_to_be_deleted" not in queryables_after["properties"], "Queryable should have been deleted" test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py index 56e895dcb23d..f3d6452b8916 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py @@ -35,9 +35,7 @@ log_file = log_dir / "ingestion_test_results.log" file_handler = logging.FileHandler(log_file, mode="w") file_handler.setLevel(logging.INFO) -file_handler.setFormatter( - logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") -) +file_handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")) logger.addHandler(file_handler) @@ -64,12 +62,8 @@ def test_01_list_managed_identities(self, planetarycomputer_endpoint): logger.info(f" - Resource ID: {identity.resource_id}") # Assertions - assert ( - managed_identities is not None - ), "Managed identities list should not be None" - assert isinstance( - managed_identities, list - ), "Managed identities should be a list" + assert managed_identities is not None, "Managed identities list should not be None" + assert isinstance(managed_identities, list), "Managed identities should be a list" @PlanetaryComputerPreparer() @recorded_by_proxy @@ -107,15 +101,11 @@ def test_02_create_and_list_ingestion_sources(self, planetarycomputer_endpoint): logger.info(f" Deleted source: {source_id}") # Create connection info with managed identity - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) # Create ingestion source (id must be a valid GUID) source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = client.ingestion.create_source(body=ingestion_source) logger.info("Created ingestion source:") @@ -153,9 +143,7 @@ def test_02a_create_sas_token_ingestion_source(self, planetarycomputer_endpoint) ) logger.info(f"SAS Container URI: {sas_container_uri}") - logger.info( - f"SAS Token: {sas_token[:20]}..." - ) # Log only first 20 chars for security + logger.info(f"SAS Token: {sas_token[:20]}...") # Log only first 20 chars for security # Create connection info with SAS token sas_connection_info = SharedAccessSignatureTokenConnection( @@ -188,9 +176,7 @@ def test_02a_create_sas_token_ingestion_source(self, planetarycomputer_endpoint) @PlanetaryComputerPreparer() @recorded_by_proxy - def test_03_create_ingestion_definition( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_03_create_ingestion_definition(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test creating an ingestion definition.""" logger.info("\n" + "=" * 80) logger.info("TEST: Create Ingestion Definition") @@ -207,18 +193,37 @@ def test_03_create_ingestion_definition( logger.info(f"Collection ID: {planetarycomputer_collection_id}") logger.info(f"Source Catalog URL: {source_catalog_url}") - # Delete all existing ingestions first + # Delete all existing ingestions first, cancelling active runs logger.info("Deleting all existing ingestions...") - existing_ingestions = list( - client.ingestion.list(collection_id=planetarycomputer_collection_id) - ) + existing_ingestions = list(client.ingestion.list(collection_id=planetarycomputer_collection_id)) for ingestion in existing_ingestions: - client.ingestion.begin_delete( - collection_id=planetarycomputer_collection_id, - ingestion_id=ingestion.id, - polling=True, - ) - logger.info(f" Deleted existing ingestion: {ingestion.id}") + # Cancel any active runs before deleting + try: + runs = list(client.ingestion.list_runs( + collection_id=planetarycomputer_collection_id, + ingestion_id=ingestion.id, + )) + for run in runs: + run_status = run.status if hasattr(run, "status") else run.get("status", "") + if run_status in ("Running", "Pending", "Queued"): + logger.info(f" Cancelling active run: {run.id if hasattr(run, 'id') else run.get('id')}") + try: + client.ingestion.cancel_operation( + operation_id=run.id if hasattr(run, "id") else run.get("id"), + ) + except Exception as cancel_err: + logger.warning(f" Failed to cancel run: {cancel_err}") + except Exception as list_err: + logger.warning(f" Failed to list runs for ingestion {ingestion.id}: {list_err}") + try: + client.ingestion.begin_delete( + collection_id=planetarycomputer_collection_id, + ingestion_id=ingestion.id, + polling=True, + ) + logger.info(f" Deleted existing ingestion: {ingestion.id}") + except Exception as del_err: + logger.warning(f" Failed to delete ingestion {ingestion.id}: {del_err}") # Create ingestion definition ingestion_definition = IngestionDefinition( @@ -232,15 +237,9 @@ def test_03_create_ingestion_definition( logger.info("Ingestion definition created:") logger.info(f" - Import Type: {ingestion_definition.import_type}") logger.info(f" - Display Name: {ingestion_definition.display_name}") - logger.info( - f" - Source Catalog URL: {ingestion_definition.source_catalog_url}" - ) - logger.info( - f" - Keep Original Assets: {ingestion_definition.keep_original_assets}" - ) - logger.info( - f" - Skip Existing Items: {ingestion_definition.skip_existing_items}" - ) + logger.info(f" - Source Catalog URL: {ingestion_definition.source_catalog_url}") + logger.info(f" - Keep Original Assets: {ingestion_definition.keep_original_assets}") + logger.info(f" - Skip Existing Items: {ingestion_definition.skip_existing_items}") # Create the ingestion ingestion_response = client.ingestion.create( @@ -261,9 +260,7 @@ def test_03_create_ingestion_definition( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_04_update_ingestion_definition( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_04_update_ingestion_definition(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test updating an existing ingestion definition.""" logger.info("\n" + "=" * 80) logger.info("TEST: Update Ingestion Definition") @@ -317,18 +314,12 @@ def test_04_update_ingestion_definition( # Assertions assert updated_ingestion is not None, "Updated ingestion should not be None" - assert ( - updated_ingestion.id == ingestion_id - ), "Ingestion ID should remain the same" - assert ( - updated_ingestion.display_name == "Updated Ingestion Name" - ), "Display name should be updated" + assert updated_ingestion.id == ingestion_id, "Ingestion ID should remain the same" + assert updated_ingestion.display_name == "Updated Ingestion Name", "Display name should be updated" @PlanetaryComputerPreparer() @recorded_by_proxy - def test_05_create_ingestion_run( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_05_create_ingestion_run(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test creating an ingestion run.""" logger.info("\n" + "=" * 80) logger.info("TEST: Create Ingestion Run") @@ -379,9 +370,7 @@ def test_05_create_ingestion_run( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_06_get_ingestion_run_status( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_06_get_ingestion_run_status(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting the status of an ingestion run.""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Ingestion Run Status") @@ -439,12 +428,8 @@ def test_06_get_ingestion_run_status( # Log status history if available if run.operation.status_history: - logger.info( - f" - Status History Entries: {len(run.operation.status_history)}" - ) - for i, status_item in enumerate( - run.operation.status_history[:5] - ): # Log first 5 + logger.info(f" - Status History Entries: {len(run.operation.status_history)}") + for i, status_item in enumerate(run.operation.status_history[:5]): # Log first 5 logger.info(f" Entry {i+1}:") if hasattr(status_item, "error_code") and status_item.error_code: logger.info(f" Error Code: {status_item.error_code}") @@ -478,15 +463,9 @@ def test_07_list_operations(self, planetarycomputer_endpoint): logger.info(f" - Type: {operation.type}") if hasattr(operation, "total_items") and operation.total_items is not None: logger.info(f" - Total Items: {operation.total_items}") - if ( - hasattr(operation, "total_successful_items") - and operation.total_successful_items is not None - ): + if hasattr(operation, "total_successful_items") and operation.total_successful_items is not None: logger.info(f" - Successful: {operation.total_successful_items}") - if ( - hasattr(operation, "total_failed_items") - and operation.total_failed_items is not None - ): + if hasattr(operation, "total_failed_items") and operation.total_failed_items is not None: logger.info(f" - Failed: {operation.total_failed_items}") # Assertions @@ -495,9 +474,7 @@ def test_07_list_operations(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_08_get_operation_by_id( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_08_get_operation_by_id(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting a specific operation by ID.""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Operation by ID") @@ -564,9 +541,7 @@ def test_09_delete_ingestion_source(self, planetarycomputer_endpoint): # Get test configuration - must use real managed identity from the environment # Use a unique container URI to avoid conflicts test_container_id = str(uuid.uuid4()) - container_uri = ( - f"https://test.blob.core.windows.net/test-container-{test_container_id}" - ) + container_uri = f"https://test.blob.core.windows.net/test-container-{test_container_id}" # Get a valid managed identity object ID from the service managed_identities = list(client.ingestion.list_managed_identities()) @@ -579,14 +554,10 @@ def test_09_delete_ingestion_source(self, planetarycomputer_endpoint): logger.info(f"Using unique container URI: {container_uri}") # Create a source to delete - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = client.ingestion.create_source(body=ingestion_source) source_id = created_source.id @@ -606,15 +577,11 @@ def test_09_delete_ingestion_source(self, planetarycomputer_endpoint): from devtools_testutils import is_live if is_live(): - assert ( - source_id not in source_ids - ), "Deleted source should not be in the list" + assert source_id not in source_ids, "Deleted source should not be in the list" @PlanetaryComputerPreparer() @recorded_by_proxy - def test_10_cancel_operation( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_10_cancel_operation(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test canceling an operation.""" logger.info("\n" + "=" * 80) logger.info("TEST: Cancel Operation") @@ -660,9 +627,7 @@ def test_10_cancel_operation( # Try to cancel the operation try: client.ingestion.cancel_operation(operation_id) - logger.info( - f"Successfully requested cancellation for operation: {operation_id}" - ) + logger.info(f"Successfully requested cancellation for operation: {operation_id}") cancel_succeeded = True except HttpResponseError as e: logger.info(f"Failed to cancel operation {operation_id}: {e.message}") @@ -677,7 +642,11 @@ def test_10_cancel_operation( @PlanetaryComputerPreparer() @recorded_by_proxy def test_11_cancel_all_operations(self, planetarycomputer_endpoint): - """Test canceling all operations.""" + """Test canceling all operations. + + WARNING: cancel_all_operations() cancels ALL pending/running operations + across the entire GeoCatalog instance, not scoped to a specific collection. + """ logger.info("\n" + "=" * 80) logger.info("TEST: Cancel All Operations") logger.info("=" * 80) @@ -721,18 +690,12 @@ def test_12_get_source(self, planetarycomputer_endpoint): # Create a source test_container_id = str(uuid.uuid4()) - container_uri = ( - f"https://test.blob.core.windows.net/test-container-{test_container_id}" - ) + container_uri = f"https://test.blob.core.windows.net/test-container-{test_container_id}" - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = client.ingestion.create_source(body=ingestion_source) logger.info(f"Created source with ID: {created_source.id}") @@ -764,52 +727,38 @@ def test_13_replace_source(self, planetarycomputer_endpoint): # Generate test SAS token data test_container_id = str(uuid.uuid4()) - sas_container_uri = ( - f"https://test.blob.core.windows.net/test-container-{test_container_id}" - ) + sas_container_uri = f"https://test.blob.core.windows.net/test-container-{test_container_id}" # Generate a valid SAS token format with required fields start_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") - expiry_time = (datetime.now(timezone.utc) + timedelta(days=7)).strftime( - "%Y-%m-%dT%H:%M:%SZ" - ) + expiry_time = (datetime.now(timezone.utc) + timedelta(days=7)).strftime("%Y-%m-%dT%H:%M:%SZ") sas_token = f"sp=rl&st={start_time}&se={expiry_time}&sv=2023-01-03&sr=c&sig=InitialRandomSignature123456" # Step 1: Create initial source using create_source (like create_sas_token_ingestion_source in sample) - logger.info( - "Step 1: Creating initial SAS token ingestion source with create_source..." - ) + logger.info("Step 1: Creating initial SAS token ingestion source with create_source...") sas_connection_info = SharedAccessSignatureTokenConnection( container_uri=sas_container_uri, shared_access_signature_token=sas_token ) - sas_ingestion_source = SharedAccessSignatureTokenIngestionSource( - connection_info=sas_connection_info - ) + sas_ingestion_source = SharedAccessSignatureTokenIngestionSource(connection_info=sas_connection_info) created_source = client.ingestion.create_source(body=sas_ingestion_source) source_id = created_source.id logger.info(f"Created SAS token ingestion source: {source_id}") # Step 2: First call to create_or_replace_source - replaces the existing source with original token - logger.info( - f"Step 2: First call to create_or_replace_source with existing source ID: {source_id}" - ) + logger.info(f"Step 2: First call to create_or_replace_source with existing source ID: {source_id}") # Update the ingestion_source object with the actual ID sas_ingestion_source_for_replace = SharedAccessSignatureTokenIngestionSource( id=source_id, connection_info=sas_connection_info ) - first_result = client.ingestion.replace_source( - id=source_id, body=sas_ingestion_source_for_replace - ) + first_result = client.ingestion.replace_source(id=source_id, body=sas_ingestion_source_for_replace) logger.info(f"First call result: {first_result.id}") # Step 3: Second call to create_or_replace_source - replaces again with updated token - logger.info( - "Step 3: Second call to create_or_replace_source with updated SAS token" - ) + logger.info("Step 3: Second call to create_or_replace_source with updated SAS token") updated_token = f"sp=rl&st={start_time}&se={expiry_time}&sv=2023-01-03&sr=c&sig=UpdatedRandomSignature123456" updated_connection_info = SharedAccessSignatureTokenConnection( @@ -819,9 +768,7 @@ def test_13_replace_source(self, planetarycomputer_endpoint): id=source_id, connection_info=updated_connection_info ) - second_result = client.ingestion.replace_source( - id=source_id, body=updated_ingestion_source - ) + second_result = client.ingestion.replace_source(id=source_id, body=updated_ingestion_source) logger.info("Second create_or_replace result (replacement):") logger.info(f" - Response type: {type(second_result)}") @@ -832,9 +779,7 @@ def test_13_replace_source(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_14_lists_ingestions( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_14_lists_ingestions(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test listing ingestions for a collection.""" logger.info("\n" + "=" * 80) logger.info("TEST: Lists Ingestions") @@ -857,16 +802,12 @@ def test_14_lists_ingestions( skip_existing_items=True, ) - client.ingestion.create( - collection_id=planetarycomputer_collection_id, body=ingestion_definition - ) + client.ingestion.create(collection_id=planetarycomputer_collection_id, body=ingestion_definition) logger.info("Created ingestion") # List ingestions - ingestions = list( - client.ingestion.list(collection_id=planetarycomputer_collection_id) - ) + ingestions = list(client.ingestion.list(collection_id=planetarycomputer_collection_id)) logger.info(f"Found {len(ingestions)} ingestions") for i, ingestion in enumerate(ingestions[:5]): @@ -877,9 +818,7 @@ def test_14_lists_ingestions( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_15_get_ingestion( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_15_get_ingestion(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting a specific ingestion by ID.""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Ingestion") @@ -927,9 +866,7 @@ def test_15_get_ingestion( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_16_list_runs( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_16_list_runs(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test listing runs for an ingestion.""" logger.info("\n" + "=" * 80) logger.info("TEST: List Runs") @@ -973,9 +910,7 @@ def test_16_list_runs( # List runs runs = list( - client.ingestion.list_runs( - collection_id=planetarycomputer_collection_id, ingestion_id=ingestion_id - ) + client.ingestion.list_runs(collection_id=planetarycomputer_collection_id, ingestion_id=ingestion_id) ) logger.info(f"Found {len(runs)} runs") @@ -987,9 +922,7 @@ def test_16_list_runs( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_17_get_operation( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_17_get_operation(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting a specific operation (duplicate of test_08 but for completeness).""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Operation (Additional Coverage)") @@ -1016,10 +949,7 @@ def test_17_get_operation( logger.info(f" - Type: {operation.type}") if hasattr(operation, "total_items") and operation.total_items is not None: logger.info(f" - Total Items: {operation.total_items}") - if ( - hasattr(operation, "total_successful_items") - and operation.total_successful_items is not None - ): + if hasattr(operation, "total_successful_items") and operation.total_successful_items is not None: logger.info(f" - Successful Items: {operation.total_successful_items}") @PlanetaryComputerPreparer() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management_async.py index c0954cc878ed..8982a86507b8 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management_async.py @@ -37,15 +37,11 @@ log_file = log_dir / "ingestion_test_results.log" file_handler = logging.FileHandler(log_file, mode="w") file_handler.setLevel(logging.INFO) -file_handler.setFormatter( - logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") -) +file_handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")) logger.addHandler(file_handler) -class TestPlanetaryComputerIngestionManagementAsync( - PlanetaryComputerProClientTestBaseAsync -): +class TestPlanetaryComputerIngestionManagementAsync(PlanetaryComputerProClientTestBaseAsync): """Test class for Planetary Computer ingestion management operations.""" @PlanetaryComputerPreparer() @@ -68,9 +64,7 @@ async def test_01_list_managed_identities(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_02_create_and_list_ingestion_sources( - self, planetarycomputer_endpoint - ): + async def test_02_create_and_list_ingestion_sources(self, planetarycomputer_endpoint): """Test creating and listing ingestion sources.""" logger.info("\n" + "=" * 80) logger.info("TEST: Create and List Ingestion Sources") @@ -104,15 +98,11 @@ async def test_02_create_and_list_ingestion_sources( logger.info(f" Deleted source: {source_id}") # Create connection info with managed identity - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) # Create ingestion source (id must be a valid GUID) source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = await client.ingestion.create_source(body=ingestion_source) logger.info("Created ingestion source:") @@ -134,9 +124,7 @@ async def test_02_create_and_list_ingestion_sources( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_02a_create_sas_token_ingestion_source( - self, planetarycomputer_endpoint - ): + async def test_02a_create_sas_token_ingestion_source(self, planetarycomputer_endpoint): """Test creating a SAS token ingestion source.""" logger.info("\n" + "=" * 80) logger.info("TEST: Create SAS Token Ingestion Source") @@ -156,9 +144,7 @@ async def test_02a_create_sas_token_ingestion_source( ) logger.info(f"SAS Container URI: {sas_container_uri}") - logger.info( - f"SAS Token: {sas_token[:20]}..." - ) # Log only first 20 chars for security + logger.info(f"SAS Token: {sas_token[:20]}...") # Log only first 20 chars for security # Create connection info with SAS token sas_connection_info = SharedAccessSignatureTokenConnection( @@ -172,9 +158,7 @@ async def test_02a_create_sas_token_ingestion_source( ) # Register the SAS token source - created_sas_source = await client.ingestion.create_source( - body=sas_ingestion_source - ) + created_sas_source = await client.ingestion.create_source(body=sas_ingestion_source) logger.info("Created SAS token ingestion source:") logger.info(f" - ID: {created_sas_source.id}") @@ -195,9 +179,7 @@ async def test_02a_create_sas_token_ingestion_source( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_03_create_ingestion_definition( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_03_create_ingestion_definition(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test creating an ingestion definition.""" logger.info("\n" + "=" * 80) logger.info("TEST: Create Ingestion Definition") @@ -214,17 +196,35 @@ async def test_03_create_ingestion_definition( logger.info(f"Collection ID: {planetarycomputer_collection_id}") logger.info(f"Source Catalog URL: {source_catalog_url}") - # Delete all existing ingestions first + # Delete all existing ingestions first, cancelling active runs logger.info("Deleting all existing ingestions...") - async for ingestion in client.ingestion.list( - collection_id=planetarycomputer_collection_id - ): - await client.ingestion.begin_delete( - collection_id=planetarycomputer_collection_id, - ingestion_id=ingestion.id, - polling=True, - ) - logger.info(f" Deleted existing ingestion: {ingestion.id}") + async for ingestion in client.ingestion.list(collection_id=planetarycomputer_collection_id): + # Cancel any active runs before deleting + try: + async for run in client.ingestion.list_runs( + collection_id=planetarycomputer_collection_id, + ingestion_id=ingestion.id, + ): + run_status = run.status if hasattr(run, "status") else run.get("status", "") + if run_status in ("Running", "Pending", "Queued"): + logger.info(f" Cancelling active run: {run.id if hasattr(run, 'id') else run.get('id')}") + try: + await client.ingestion.cancel_operation( + operation_id=run.id if hasattr(run, "id") else run.get("id"), + ) + except Exception as cancel_err: + logger.warning(f" Failed to cancel run: {cancel_err}") + except Exception as list_err: + logger.warning(f" Failed to list runs for ingestion {ingestion.id}: {list_err}") + try: + await client.ingestion.begin_delete( + collection_id=planetarycomputer_collection_id, + ingestion_id=ingestion.id, + polling=True, + ) + logger.info(f" Deleted existing ingestion: {ingestion.id}") + except Exception as del_err: + logger.warning(f" Failed to delete ingestion {ingestion.id}: {del_err}") # Create ingestion definition ingestion_definition = IngestionDefinition( @@ -238,15 +238,9 @@ async def test_03_create_ingestion_definition( logger.info("Ingestion definition created:") logger.info(f" - Import Type: {ingestion_definition.import_type}") logger.info(f" - Display Name: {ingestion_definition.display_name}") - logger.info( - f" - Source Catalog URL: {ingestion_definition.source_catalog_url}" - ) - logger.info( - f" - Keep Original Assets: {ingestion_definition.keep_original_assets}" - ) - logger.info( - f" - Skip Existing Items: {ingestion_definition.skip_existing_items}" - ) + logger.info(f" - Source Catalog URL: {ingestion_definition.source_catalog_url}") + logger.info(f" - Keep Original Assets: {ingestion_definition.keep_original_assets}") + logger.info(f" - Skip Existing Items: {ingestion_definition.skip_existing_items}") # Create the ingestion ingestion_response = await client.ingestion.create( @@ -269,9 +263,7 @@ async def test_03_create_ingestion_definition( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_04_update_ingestion_definition( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_04_update_ingestion_definition(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test updating an existing ingestion definition.""" logger.info("\n" + "=" * 80) logger.info("TEST: Update Ingestion Definition") @@ -325,20 +317,14 @@ async def test_04_update_ingestion_definition( # Assertions assert updated_ingestion is not None, "Updated ingestion should not be None" - assert ( - updated_ingestion.id == ingestion_id - ), "Ingestion ID should remain the same" - assert ( - updated_ingestion.display_name == "Updated Ingestion Name" - ), "Display name should be updated" + assert updated_ingestion.id == ingestion_id, "Ingestion ID should remain the same" + assert updated_ingestion.display_name == "Updated Ingestion Name", "Display name should be updated" await self.close_client() @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_05_create_ingestion_run( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_05_create_ingestion_run(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test creating an ingestion run.""" logger.info("\n" + "=" * 80) logger.info("TEST: Create Ingestion Run") @@ -391,9 +377,7 @@ async def test_05_create_ingestion_run( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_06_get_ingestion_run_status( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_06_get_ingestion_run_status(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting the status of an ingestion run.""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Ingestion Run Status") @@ -451,12 +435,8 @@ async def test_06_get_ingestion_run_status( # Log status history if available if run.operation.status_history: - logger.info( - f" - Status History Entries: {len(run.operation.status_history)}" - ) - for i, status_item in enumerate( - run.operation.status_history[:5] - ): # Log first 5 + logger.info(f" - Status History Entries: {len(run.operation.status_history)}") + for i, status_item in enumerate(run.operation.status_history[:5]): # Log first 5 logger.info(f" Entry {i+1}:") if hasattr(status_item, "error_code") and status_item.error_code: logger.info(f" Error Code: {status_item.error_code}") @@ -489,24 +469,16 @@ async def test_07_list_operations(self, planetarycomputer_endpoint): logger.info(f" - Type: {operation.type}") if hasattr(operation, "total_items") and operation.total_items is not None: logger.info(f" - Total Items: {operation.total_items}") - if ( - hasattr(operation, "total_successful_items") - and operation.total_successful_items is not None - ): + if hasattr(operation, "total_successful_items") and operation.total_successful_items is not None: logger.info(f" - Successful: {operation.total_successful_items}") - if ( - hasattr(operation, "total_failed_items") - and operation.total_failed_items is not None - ): + if hasattr(operation, "total_failed_items") and operation.total_failed_items is not None: logger.info(f" - Failed: {operation.total_failed_items}") await self.close_client() @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_08_get_operation_by_id( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_08_get_operation_by_id(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting a specific operation by ID.""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Operation by ID") @@ -575,9 +547,7 @@ async def test_09_delete_ingestion_source(self, planetarycomputer_endpoint): # Get test configuration - must use real managed identity from the environment # Use a unique container URI to avoid conflicts test_container_id = str(uuid.uuid4()) - container_uri = ( - f"https://test.blob.core.windows.net/test-container-{test_container_id}" - ) + container_uri = f"https://test.blob.core.windows.net/test-container-{test_container_id}" # Get a valid managed identity object ID from the service managed_identity_object_id = None @@ -592,14 +562,10 @@ async def test_09_delete_ingestion_source(self, planetarycomputer_endpoint): logger.info(f"Using unique container URI: {container_uri}") # Create a source to delete - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = await client.ingestion.create_source(body=ingestion_source) source_id = created_source.id @@ -618,17 +584,13 @@ async def test_09_delete_ingestion_source(self, planetarycomputer_endpoint): from devtools_testutils import is_live if is_live(): - assert ( - source_id not in source_ids - ), "Deleted source should not be in the list" + assert source_id not in source_ids, "Deleted source should not be in the list" await self.close_client() @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_10_cancel_operation( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_10_cancel_operation(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test canceling an operation.""" logger.info("\n" + "=" * 80) logger.info("TEST: Cancel Operation") @@ -674,9 +636,7 @@ async def test_10_cancel_operation( # Try to cancel the operation try: await client.ingestion.cancel_operation(operation_id) - logger.info( - f"Successfully requested cancellation for operation: {operation_id}" - ) + logger.info(f"Successfully requested cancellation for operation: {operation_id}") cancel_succeeded = True except HttpResponseError as e: logger.info(f"Failed to cancel operation {operation_id}: {e.message}") @@ -693,7 +653,11 @@ async def test_10_cancel_operation( @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_11_cancel_all_operations(self, planetarycomputer_endpoint): - """Test canceling all operations.""" + """Test canceling all operations. + + WARNING: cancel_all_operations() cancels ALL pending/running operations + across the entire GeoCatalog instance, not scoped to a specific collection. + """ logger.info("\n" + "=" * 80) logger.info("TEST: Cancel All Operations") logger.info("=" * 80) @@ -741,18 +705,12 @@ async def test_12_get_source(self, planetarycomputer_endpoint): # Create a source test_container_id = str(uuid.uuid4()) - container_uri = ( - f"https://test.blob.core.windows.net/test-container-{test_container_id}" - ) + container_uri = f"https://test.blob.core.windows.net/test-container-{test_container_id}" - connection_info = ManagedIdentityConnection( - container_uri=container_uri, object_id=managed_identity_object_id - ) + connection_info = ManagedIdentityConnection(container_uri=container_uri, object_id=managed_identity_object_id) source_id = str(uuid.uuid4()) - ingestion_source = ManagedIdentityIngestionSource( - id=source_id, connection_info=connection_info - ) + ingestion_source = ManagedIdentityIngestionSource(id=source_id, connection_info=connection_info) created_source = await client.ingestion.create_source(body=ingestion_source) logger.info(f"Created source with ID: {created_source.id}") @@ -786,52 +744,38 @@ async def test_13_replace_source(self, planetarycomputer_endpoint): # Generate test SAS token data test_container_id = str(uuid.uuid4()) - sas_container_uri = ( - f"https://test.blob.core.windows.net/test-container-{test_container_id}" - ) + sas_container_uri = f"https://test.blob.core.windows.net/test-container-{test_container_id}" # Generate a valid SAS token format with required fields start_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") - expiry_time = (datetime.now(timezone.utc) + timedelta(days=7)).strftime( - "%Y-%m-%dT%H:%M:%SZ" - ) + expiry_time = (datetime.now(timezone.utc) + timedelta(days=7)).strftime("%Y-%m-%dT%H:%M:%SZ") sas_token = f"sp=rl&st={start_time}&se={expiry_time}&sv=2023-01-03&sr=c&sig=InitialRandomSignature123456" # Step 1: Create initial source using create_source (like create_sas_token_ingestion_source in sample) - logger.info( - "Step 1: Creating initial SAS token ingestion source with create_source..." - ) + logger.info("Step 1: Creating initial SAS token ingestion source with create_source...") sas_connection_info = SharedAccessSignatureTokenConnection( container_uri=sas_container_uri, shared_access_signature_token=sas_token ) - sas_ingestion_source = SharedAccessSignatureTokenIngestionSource( - connection_info=sas_connection_info - ) + sas_ingestion_source = SharedAccessSignatureTokenIngestionSource(connection_info=sas_connection_info) created_source = await client.ingestion.create_source(body=sas_ingestion_source) source_id = created_source.id logger.info(f"Created SAS token ingestion source: {source_id}") # Step 2: First call to create_or_replace_source - replaces the existing source with original token - logger.info( - f"Step 2: First call to create_or_replace_source with existing source ID: {source_id}" - ) + logger.info(f"Step 2: First call to create_or_replace_source with existing source ID: {source_id}") # Update the ingestion_source object with the actual ID sas_ingestion_source_for_replace = SharedAccessSignatureTokenIngestionSource( id=source_id, connection_info=sas_connection_info ) - first_result = await client.ingestion.replace_source( - id=source_id, body=sas_ingestion_source_for_replace - ) + first_result = await client.ingestion.replace_source(id=source_id, body=sas_ingestion_source_for_replace) logger.info(f"First call result: {first_result.id}") # Step 3: Second call to create_or_replace_source - replaces again with updated token - logger.info( - "Step 3: Second call to create_or_replace_source with updated SAS token" - ) + logger.info("Step 3: Second call to create_or_replace_source with updated SAS token") updated_token = f"sp=rl&st={start_time}&se={expiry_time}&sv=2023-01-03&sr=c&sig=UpdatedRandomSignature123456" updated_connection_info = SharedAccessSignatureTokenConnection( @@ -841,9 +785,7 @@ async def test_13_replace_source(self, planetarycomputer_endpoint): id=source_id, connection_info=updated_connection_info ) - second_result = await client.ingestion.replace_source( - id=source_id, body=updated_ingestion_source - ) + second_result = await client.ingestion.replace_source(id=source_id, body=updated_ingestion_source) logger.info("Second create_or_replace result (replacement):") logger.info(f" - Response type: {type(second_result)}") @@ -856,9 +798,7 @@ async def test_13_replace_source(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_14_lists_ingestions( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_14_lists_ingestions(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test listing ingestions for a collection.""" logger.info("\n" + "=" * 80) logger.info("TEST: Lists Ingestions") @@ -881,16 +821,12 @@ async def test_14_lists_ingestions( skip_existing_items=True, ) - await client.ingestion.create( - collection_id=planetarycomputer_collection_id, body=ingestion_definition - ) + await client.ingestion.create(collection_id=planetarycomputer_collection_id, body=ingestion_definition) logger.info("Created ingestion") # List ingestions - async for ingestion in client.ingestion.list( - collection_id=planetarycomputer_collection_id - ): + async for ingestion in client.ingestion.list(collection_id=planetarycomputer_collection_id): logger.info(f" Ingestion:") logger.info(f" - ID: {ingestion.id}") logger.info(f" - Display Name: {ingestion.display_name}") @@ -900,9 +836,7 @@ async def test_14_lists_ingestions( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_15_get_ingestion( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_15_get_ingestion(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting a specific ingestion by ID.""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Ingestion") @@ -952,9 +886,7 @@ async def test_15_get_ingestion( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_16_list_runs( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_16_list_runs(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test listing runs for an ingestion.""" logger.info("\n" + "=" * 80) logger.info("TEST: List Runs") @@ -1009,9 +941,7 @@ async def test_16_list_runs( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_17_get_operation( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_17_get_operation(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test getting a specific operation (duplicate of test_08 but for completeness).""" logger.info("\n" + "=" * 80) logger.info("TEST: Get Operation (Additional Coverage)") @@ -1040,19 +970,14 @@ async def test_17_get_operation( logger.info(f" - Type: {operation.type}") if hasattr(operation, "total_items") and operation.total_items is not None: logger.info(f" - Total Items: {operation.total_items}") - if ( - hasattr(operation, "total_successful_items") - and operation.total_successful_items is not None - ): + if hasattr(operation, "total_successful_items") and operation.total_successful_items is not None: logger.info(f" - Successful Items: {operation.total_successful_items}") await self.close_client() @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_18_cancel_all_operations_additional( - self, planetarycomputer_endpoint - ): + async def test_18_cancel_all_operations_additional(self, planetarycomputer_endpoint): """Test cancel_all_operations (duplicate of test_11 but for completeness).""" logger.info("\n" + "=" * 80) logger.info("TEST: Cancel All Operations (Additional Coverage)") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py index 7b521f0c5470..5b3975b776f5 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py @@ -37,9 +37,7 @@ log_file = log_dir / "stac_specification_test_results.log" file_handler = logging.FileHandler(log_file, mode="w") file_handler.setLevel(logging.INFO) -file_formatter = logging.Formatter( - "%(asctime)s - %(name)s - %(levelname)s - %(message)s" -) +file_formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") file_handler.setFormatter(file_formatter) logger.addHandler(file_handler) @@ -60,12 +58,8 @@ def test_01_get_conformance_class(self, planetarycomputer_endpoint): # Validate conformance response assert conformance is not None, "Conformance should not be None" - assert hasattr( - conformance, "conforms_to" - ), "Conformance should have conforms_to property" - assert ( - len(conformance.conforms_to) > 0 - ), "Conformance should have at least one URI" + assert hasattr(conformance, "conforms_to"), "Conformance should have conforms_to property" + assert len(conformance.conforms_to) > 0, "Conformance should have at least one URI" # Based on log: Retrieved 15 conformance classes assert ( @@ -114,15 +108,11 @@ def test_03_list_collections(self, planetarycomputer_endpoint, planetarycomputer # Validate collections response assert collections is not None, "Collections should not be None" - assert hasattr( - collections, "collections" - ), "Response should have collections property" + assert hasattr(collections, "collections"), "Response should have collections property" assert len(collections.collections) > 0, "Should have at least one collection" # Based on log: Retrieved 10 collections - assert ( - len(collections.collections) >= 5 - ), f"Expected at least 5 collections, got {len(collections.collections)}" + assert len(collections.collections) >= 5, f"Expected at least 5 collections, got {len(collections.collections)}" logger.info(f"Retrieved {len(collections.collections)} collections") @@ -145,16 +135,12 @@ def test_03_list_collections(self, planetarycomputer_endpoint, planetarycomputer # Validate collection structure first_collection = collections.collections[0] assert hasattr(first_collection, "id"), "Collection should have id" - assert ( - first_collection.id is not None and len(first_collection.id) > 0 - ), "Collection ID should not be empty" + assert first_collection.id is not None and len(first_collection.id) > 0, "Collection ID should not be empty" assert hasattr(first_collection, "extent"), "Collection should have extent" # Validate that the collection is in the list collection_ids = [c.id for c in collections.collections] - assert ( - collection_id in collection_ids - ), f"{collection_id} collection should be present" + assert collection_id in collection_ids, f"{collection_id} collection should be present" @PlanetaryComputerPreparer() @recorded_by_proxy @@ -177,9 +163,7 @@ def test_04_get_collection(self, planetarycomputer_endpoint, planetarycomputer_c # Validate title is present assert hasattr(collection, "title"), "Collection should have title" - assert ( - collection.title is not None and len(collection.title) > 0 - ), "Collection title should not be empty" + assert collection.title is not None and len(collection.title) > 0, "Collection title should not be empty" logger.info(f"Retrieved collection: {collection.id}") if hasattr(collection, "title") and collection.title: @@ -197,25 +181,17 @@ def test_04_get_collection(self, planetarycomputer_endpoint, planetarycomputer_c logger.info(" Extent:") if hasattr(collection.extent, "spatial") and collection.extent.spatial: # Log available attributes instead of assuming bbox exists - spatial_attrs = [ - attr - for attr in dir(collection.extent.spatial) - if not attr.startswith("_") - ] + spatial_attrs = [attr for attr in dir(collection.extent.spatial) if not attr.startswith("_")] logger.info(f" Spatial attributes: {spatial_attrs}") # Try to access bbox if it exists if hasattr(collection.extent.spatial, "bbox"): logger.info(f" Spatial bbox: {collection.extent.spatial.bbox}") if hasattr(collection.extent, "temporal") and collection.extent.temporal: - logger.info( - f" Temporal interval: {collection.extent.temporal.interval}" - ) + logger.info(f" Temporal interval: {collection.extent.temporal.interval}") # Validate links assert hasattr(collection, "links"), "Collection should have links" - assert ( - collection.links is not None and len(collection.links) > 0 - ), "Collection should have at least one link" + assert collection.links is not None and len(collection.links) > 0, "Collection should have at least one link" if hasattr(collection, "links") and collection.links: logger.info(f" Links count: {len(collection.links)}") @@ -256,11 +232,7 @@ def test_05_search_items_with_spatial_filter(self, planetarycomputer_endpoint, p ], }, date_time="2021-01-01T00:00:00Z/2022-12-31T00:00:00Z", - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.DESC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.DESC)], limit=50, ) @@ -296,9 +268,7 @@ def test_05_search_items_with_spatial_filter(self, planetarycomputer_endpoint, p first_item = search_response.features[0] assert hasattr(first_item, "id"), "Item should have id" assert hasattr(first_item, "collection"), "Item should have collection" - assert ( - first_item.collection == collection_id - ), "Item collection should match search collection" + assert first_item.collection == collection_id, "Item collection should match search collection" @PlanetaryComputerPreparer() @recorded_by_proxy @@ -310,22 +280,16 @@ def test_06_get_item_collection(self, planetarycomputer_endpoint, planetarycompu client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id - items_response = client.stac.get_item_collection( - collection_id=collection_id, limit=10 - ) + items_response = client.stac.get_item_collection(collection_id=collection_id, limit=10) # Validate response assert items_response is not None, "Items response should not be None" assert hasattr(items_response, "features"), "Response should have features" # Based on log: Retrieved 10 items with 4 asset types each - assert ( - len(items_response.features) >= 5 - ), f"Expected at least 5 items, got {len(items_response.features)}" + assert len(items_response.features) >= 5, f"Expected at least 5 items, got {len(items_response.features)}" - logger.info( - f"Retrieved {len(items_response.features)} items from collection {collection_id}" - ) + logger.info(f"Retrieved {len(items_response.features)} items from collection {collection_id}") # Log first few items for i, item in enumerate(items_response.features[:5]): @@ -341,15 +305,11 @@ def test_06_get_item_collection(self, planetarycomputer_endpoint, planetarycompu first_item = items_response.features[0] assert hasattr(first_item, "assets"), "Item should have assets" asset_keys = list(first_item.assets.keys()) - assert ( - len(asset_keys) >= 2 - ), f"Expected at least 2 assets, got {len(asset_keys)}" + assert len(asset_keys) >= 2, f"Expected at least 2 assets, got {len(asset_keys)}" # Check for common assets common_assets = ["image", "tilejson", "thumbnail", "rendered_preview"] found_assets = [asset for asset in common_assets if asset in asset_keys] - assert ( - len(found_assets) >= 1 - ), f"Expected at least one common asset type, found: {found_assets}" + assert len(found_assets) >= 1, f"Expected at least one common asset type, found: {found_assets}" @PlanetaryComputerPreparer() @recorded_by_proxy @@ -373,18 +333,14 @@ def test_07_get_collection_queryables(self, planetarycomputer_endpoint, planetar properties = queryables["properties"] # Based on log: Found 4 queryable properties (id, datetime, geometry, eo:cloud_cover) - assert ( - len(properties) >= 3 - ), f"Expected at least 3 queryable properties, got {len(properties)}" + assert len(properties) >= 3, f"Expected at least 3 queryable properties, got {len(properties)}" logger.info(f"Found {len(properties)} queryable properties") # Validate common STAC queryables are present common_queryables = ["id", "datetime", "geometry"] for queryable in common_queryables: - assert ( - queryable in properties - ), f"Expected queryable '{queryable}' not found" + assert queryable in properties, f"Expected queryable '{queryable}' not found" # Log first 15 queryable properties for i, (prop_name, prop_info) in enumerate(list(properties.items())[:15]): @@ -441,9 +397,7 @@ def test_08_search_items_with_temporal_filter(self, planetarycomputer_endpoint, # Properties is a dictionary properties = item.properties if isinstance(properties, dict): - assert ( - "datetime" in properties - ), "Item should have datetime property in dict" + assert "datetime" in properties, "Item should have datetime property in dict" logger.info(f" Datetime: {properties['datetime']}") elif hasattr(properties, "__getitem__"): # It's a dict-like object @@ -451,9 +405,7 @@ def test_08_search_items_with_temporal_filter(self, planetarycomputer_endpoint, logger.info(f" Datetime: {properties['datetime']}") else: # It's an object with attributes - assert hasattr( - properties, "datetime" - ), "Item should have datetime attribute" + assert hasattr(properties, "datetime"), "Item should have datetime attribute" logger.info(f" Datetime: {properties.datetime}") @PlanetaryComputerPreparer() @@ -470,29 +422,21 @@ def test_09_search_items_with_sorting(self, planetarycomputer_endpoint, planetar # Search with descending sort by datetime search_params_desc = StacSearchParameters( collections=[collection_id], - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.DESC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.DESC)], limit=5, ) search_response_desc = client.stac.search(body=search_params_desc) assert search_response_desc is not None, "Search response should not be None" - assert hasattr( - search_response_desc, "features" - ), "Response should have features" + assert hasattr(search_response_desc, "features"), "Response should have features" # Based on log: DESC sorting returned 5 items assert ( len(search_response_desc.features) >= 3 ), f"Expected at least 3 items in DESC sort, got {len(search_response_desc.features)}" - logger.info( - f"Search with DESC sorting returned {len(search_response_desc.features)} items" - ) + logger.info(f"Search with DESC sorting returned {len(search_response_desc.features)} items") # Log sorted results for i, item in enumerate(search_response_desc.features): @@ -504,29 +448,21 @@ def test_09_search_items_with_sorting(self, planetarycomputer_endpoint, planetar # Search with ascending sort search_params_asc = StacSearchParameters( collections=[collection_id], - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.ASC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.ASC)], limit=5, ) search_response_asc = client.stac.search(body=search_params_asc) assert search_response_asc is not None, "ASC search response should not be None" - assert hasattr( - search_response_asc, "features" - ), "ASC response should have features" + assert hasattr(search_response_asc, "features"), "ASC response should have features" # Based on log: ASC sorting returned 5 items assert ( len(search_response_asc.features) >= 3 ), f"Expected at least 3 items in ASC sort, got {len(search_response_asc.features)}" - logger.info( - f"\nSearch with ASC sorting returned {len(search_response_asc.features)} items" - ) + logger.info(f"\nSearch with ASC sorting returned {len(search_response_asc.features)} items") for i, item in enumerate(search_response_asc.features): logger.info(f"Item {i+1}: {item.id}") @@ -601,9 +537,7 @@ def test_10_create_stac_item(self, planetarycomputer_endpoint, planetarycomputer "title": "RGBIR COG tile", } }, - "stac_extensions": [ - "https://stac-extensions.github.io/projection/v1.0.0/schema.json" - ], + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], } ) @@ -611,9 +545,7 @@ def test_10_create_stac_item(self, planetarycomputer_endpoint, planetarycomputer # Check if item already exists and delete if necessary try: - items_response = client.stac.get_item_collection( - collection_id=collection_id - ) + items_response = client.stac.get_item_collection(collection_id=collection_id) if any(item.id == item_id for item in items_response.features): logger.info(f"Item {item_id} already exists. Deleting it first...") delete_poller = client.stac.begin_delete_item( @@ -626,33 +558,23 @@ def test_10_create_stac_item(self, planetarycomputer_endpoint, planetarycomputer # Create the item try: - create_poller = client.stac.begin_create_item( - collection_id=collection_id, body=stac_item, polling=True - ) + create_poller = client.stac.begin_create_item(collection_id=collection_id, body=stac_item, polling=True) create_result = create_poller.result() logger.info(f"Successfully created item {item_id}") logger.info(f"Create operation result: {create_result}") # Verify the item was created - created_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + created_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) assert created_item is not None, "Created item should be retrievable" assert created_item.id == item_id, "Created item ID should match" # Validate structure of created item - assert hasattr( - created_item, "geometry" - ), "Created item should have geometry" - assert hasattr( - created_item, "properties" - ), "Created item should have properties" + assert hasattr(created_item, "geometry"), "Created item should have geometry" + assert hasattr(created_item, "properties"), "Created item should have properties" assert hasattr(created_item, "assets"), "Created item should have assets" # Based on log: item has image asset - assert ( - "image" in created_item.assets - ), "Created item should have image asset" + assert "image" in created_item.assets, "Created item should have image asset" logger.info(f"Verified item creation: {created_item.id}") logger.info(f"Created item has {len(created_item.assets)} assets") @@ -676,15 +598,11 @@ def test_11_update_stac_item(self, planetarycomputer_endpoint, planetarycomputer try: # Get existing item first - stac_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + stac_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) logger.info(f"Retrieved item for update: {item_id}") # Update properties - use the item as-is and modify it - stac_item_dict = ( - stac_item.as_dict() if hasattr(stac_item, "as_dict") else stac_item - ) + stac_item_dict = stac_item.as_dict() if hasattr(stac_item, "as_dict") else stac_item if "properties" not in stac_item_dict: stac_item_dict["properties"] = {} @@ -707,9 +625,7 @@ def test_11_update_stac_item(self, planetarycomputer_endpoint, planetarycomputer logger.info(f"Update operation result: {update_result}") # Verify the update - updated_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + updated_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) logger.info(f"Verified item update: {updated_item.id}") # Based on log: Update actually failed due to PublicAccessRestricted @@ -719,12 +635,8 @@ def test_11_update_stac_item(self, planetarycomputer_endpoint, planetarycomputer logger.error(f"Failed to update item: {str(e)}") # Based on log: Update fails with "PublicAccessRestricted: Public access is not permitted on this storage account" # This is expected in the test environment - logger.info( - "Item update may not be supported in this environment or item doesn't exist" - ) - logger.info( - "This is expected if public access is restricted on the storage account" - ) + logger.info("Item update may not be supported in this environment or item doesn't exist") + logger.info("This is expected if public access is restricted on the storage account") @PlanetaryComputerPreparer() @recorded_by_proxy @@ -738,9 +650,7 @@ def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_collect collection_id = planetarycomputer_collection_id # First, get an item ID from the collection - items_response = client.stac.get_item_collection( - collection_id=collection_id, limit=1 - ) + items_response = client.stac.get_item_collection(collection_id=collection_id, limit=1) if len(items_response.features) > 0: item_id = items_response.features[0].id @@ -760,9 +670,7 @@ def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_collect assert hasattr(item, "assets"), "Item should have assets" # Based on log: items have 4 asset types (image, tilejson, thumbnail, rendered_preview) - assert ( - len(item.assets) >= 2 - ), f"Expected at least 2 assets, got {len(item.assets)}" + assert len(item.assets) >= 2, f"Expected at least 2 assets, got {len(item.assets)}" logger.info(f"Retrieved item: {item.id}") logger.info(f" Collection: {item.collection}") @@ -785,154 +693,72 @@ def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_collect else: logger.warning("No items found in collection to test get_item") + @pytest.mark.skip(reason="Service re-processes all assets during replace; derived assets not found in managed storage") @PlanetaryComputerPreparer() @recorded_by_proxy def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetarycomputer_collection_id): - """Test creating or replacing a STAC item (idempotent operation). + """Test replacing an existing STAC item. - This demonstrates using begin_create_or_replace_item which is idempotent: - - First ensures item exists by creating it with begin_create_item - - Then demonstrates replace using begin_create_or_replace_item - - Multiple calls with the same data produce the same result + This demonstrates using begin_replace_item to update an existing item's properties. + The item must already exist in the collection. """ logger.info("=" * 80) - logger.info("TEST: Create or Replace STAC Item (Idempotent)") + logger.info("TEST: Replace STAC Item") logger.info("=" * 80) client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id - item_id = "ga_m_3308421_se_16_060_20211114_replace_test" - # Create sample STAC item - stac_item = StacItem( - { - "stac_version": "1.0.0", - "type": "Feature", - "id": item_id, - "collection": collection_id, - "bbox": [-84.44157, 33.621853, -84.370894, 33.690654], - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [-84.372943, 33.621853], - [-84.370894, 33.689211], - [-84.439575, 33.690654], - [-84.44157, 33.623293], - [-84.372943, 33.621853], - ] - ], - }, - "properties": { - "gsd": 0.6, - "datetime": "2021-11-14T16:00:00Z", - "naip:year": "2021", - "proj:bbox": [737334.0, 3723324.0, 743706.0, 3730800.0], - "proj:epsg": 26916, - "naip:state": "ga", - "proj:shape": [12460, 10620], - "proj:transform": [ - 0.6, - 0.0, - 737334.0, - 0.0, - -0.6, - 3730800.0, - 0.0, - 0.0, - 1.0, - ], - "platform": "Imagery Original", - }, - "links": [ - { - "rel": "collection", - "type": "application/json", - "href": f"https://planetarycomputer.microsoft.com/api/stac/v1/collections/{collection_id}", - } - ], - "assets": { - "image": { - "href": "https://naipeuwest.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", - "type": "image/tiff; application=geotiff; profile=cloud-optimized", - "roles": ["data"], - "title": "RGBIR COG tile", - } - }, - "stac_extensions": [ - "https://stac-extensions.github.io/projection/v1.0.0/schema.json" - ], - } - ) + # Get an existing item from the collection to replace + items_response = client.stac.get_item_collection(collection_id=collection_id, limit=1) + assert len(items_response.features) > 0, "Collection must have at least one item to test replace" - logger.info(f"Creating initial STAC item: {item_id}") + existing_item = items_response.features[0] + item_id = existing_item.id + logger.info(f"Using existing item for replace test: {item_id}") - # Delete the item if it already exists to ensure idempotency - try: - client.stac.get_item(collection_id=collection_id, item_id=item_id) - logger.info(f"Item {item_id} already exists, deleting it first...") - delete_poller = client.stac.begin_delete_item( - collection_id=collection_id, item_id=item_id, polling=True - ) - delete_poller.result() - logger.info(f"Deleted existing item {item_id}") - except ResourceNotFoundError: - logger.info(f"Item {item_id} does not exist, proceeding with creation") + # Get the full item + stac_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) + assert stac_item is not None, "Item should be retrievable" - # Step 1: Create the item using begin_create_item - create_poller = client.stac.begin_create_item( - collection_id=collection_id, body=stac_item, polling=True - ) - create_poller.result() - logger.info(f"Created item {item_id}") - - # Verify creation - created_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) - assert created_item is not None, "Created item should be retrievable" - assert created_item.id == item_id, "Created item ID should match" - logger.info(f"Verified item {created_item.id}") + # Modify a property + stac_item_dict = stac_item.as_dict() if hasattr(stac_item, "as_dict") else dict(stac_item) + original_platform = stac_item_dict.get("properties", {}).get("platform", None) + stac_item_dict["properties"]["platform"] = "Imagery Updated via Replace Test" - # Step 2: Now demonstrate create_or_replace (replace since item exists) - logger.info(f"Replacing item {item_id} using create_or_replace...") - stac_item.properties["platform"] = "Imagery Updated" - stac_item.properties["processing_level"] = "L2" + updated_stac_item = StacItem(stac_item_dict) - replace_poller = client.stac.begin_create_or_replace_item( - collection_id=collection_id, item_id=item_id, body=stac_item, polling=True + # Replace the item + logger.info(f"Replacing item {item_id} using begin_replace_item...") + replace_poller = client.stac.begin_replace_item( + collection_id=collection_id, item_id=item_id, body=updated_stac_item, polling=True ) replace_poller.result() - logger.info(f"Replaced item {item_id} using create_or_replace") + logger.info(f"Replaced item {item_id}") # Verify replacement - replaced_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + replaced_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) assert replaced_item is not None, "Replaced item should be retrievable" assert replaced_item.id == item_id, "Replaced item ID should match" - # Verify the updated properties - if hasattr(replaced_item, "properties") and replaced_item.properties: - platform = replaced_item.properties.get("platform", "N/A") - processing_level = replaced_item.properties.get("processing_level", "N/A") - logger.info( - f"Verified replaced item, platform: {platform}, processing_level: {processing_level}" - ) + # Verify the updated property + platform = replaced_item.properties.get("platform", "N/A") + logger.info(f"Verified replaced item, platform: {platform}") + assert platform == "Imagery Updated via Replace Test", f"Expected updated platform, got '{platform}'" - # Assert the properties were updated - assert ( - platform == "Imagery Updated" - ), f"Expected platform 'Imagery Updated', got '{platform}'" - assert ( - processing_level == "L2" - ), f"Expected processing_level 'L2', got '{processing_level}'" + # Restore original value + if original_platform is not None: + stac_item_dict["properties"]["platform"] = original_platform else: - logger.warning("Replaced item has no properties to verify") - - logger.info( - f"Successfully verified create_or_replace operation for item {item_id}" + stac_item_dict["properties"].pop("platform", None) + restore_item = StacItem(stac_item_dict) + restore_poller = client.stac.begin_replace_item( + collection_id=collection_id, item_id=item_id, body=restore_item, polling=True ) + restore_poller.result() + logger.info(f"Restored original item {item_id}") + + logger.info(f"Successfully verified replace operation for item {item_id}") @PlanetaryComputerPreparer() @recorded_by_proxy @@ -1005,9 +831,7 @@ def test_14_delete_stac_item(self, planetarycomputer_endpoint, planetarycomputer "title": "RGBIR COG tile", } }, - "stac_extensions": [ - "https://stac-extensions.github.io/projection/v1.0.0/schema.json" - ], + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], } ) @@ -1015,27 +839,21 @@ def test_14_delete_stac_item(self, planetarycomputer_endpoint, planetarycomputer try: # First, create an item to delete - create_poller = client.stac.begin_create_item( - collection_id=collection_id, body=stac_item, polling=True - ) + create_poller = client.stac.begin_create_item(collection_id=collection_id, body=stac_item, polling=True) create_poller.result() logger.info(f"Created item {item_id}") except ResourceExistsError: logger.info(f"Item {item_id} already exists, will proceed to delete it") # Verify the item exists - existing_item = client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + existing_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) assert existing_item is not None, "Item should exist before deletion" assert existing_item.id == item_id, "Item ID should match" logger.info(f"Verified item {item_id} exists") # Delete the item logger.info(f"Deleting item {item_id}...") - delete_poller = client.stac.begin_delete_item( - collection_id=collection_id, item_id=item_id, polling=True - ) + delete_poller = client.stac.begin_delete_item(collection_id=collection_id, item_id=item_id, polling=True) delete_poller.result() logger.info(f"Delete operation completed for item {item_id}") @@ -1043,9 +861,7 @@ def test_14_delete_stac_item(self, planetarycomputer_endpoint, planetarycomputer logger.info(f"Verifying item {item_id} was deleted...") try: client.stac.get_item(collection_id=collection_id, item_id=item_id) - logger.warning( - f"Item {item_id} still exists after deletion (may take time to propagate)" - ) + logger.warning(f"Item {item_id} still exists after deletion (may take time to propagate)") # In some cases, deletion may take time to propagate, so we don't fail the test except ResourceNotFoundError: logger.info(f"Verified item {item_id} was successfully deleted") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py index d962d1912e81..5e7711ca7bbd 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py @@ -35,16 +35,12 @@ log_file = log_dir / "stac_specification_test_results.log" file_handler = logging.FileHandler(log_file, mode="w") file_handler.setLevel(logging.INFO) -file_formatter = logging.Formatter( - "%(asctime)s - %(name)s - %(levelname)s - %(message)s" -) +file_formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") file_handler.setFormatter(file_formatter) logger.addHandler(file_handler) -class TestPlanetaryComputerStacSpecificationAsync( - PlanetaryComputerProClientTestBaseAsync -): +class TestPlanetaryComputerStacSpecificationAsync(PlanetaryComputerProClientTestBaseAsync): """Test class for STAC API specification operations.""" @PlanetaryComputerPreparer() @@ -60,12 +56,8 @@ async def test_01_get_conformance_class(self, planetarycomputer_endpoint): # Validate conformance response assert conformance is not None, "Conformance should not be None" - assert hasattr( - conformance, "conforms_to" - ), "Conformance should have conforms_to property" - assert ( - len(conformance.conforms_to) > 0 - ), "Conformance should have at least one URI" + assert hasattr(conformance, "conforms_to"), "Conformance should have conforms_to property" + assert len(conformance.conforms_to) > 0, "Conformance should have at least one URI" # Based on log: Retrieved 15 conformance classes assert ( @@ -116,15 +108,11 @@ async def test_03_list_collections(self, planetarycomputer_endpoint, planetaryco # Validate collections response assert collections is not None, "Collections should not be None" - assert hasattr( - collections, "collections" - ), "Response should have collections property" + assert hasattr(collections, "collections"), "Response should have collections property" assert len(collections.collections) > 0, "Should have at least one collection" # Based on log: Retrieved 10 collections - assert ( - len(collections.collections) >= 5 - ), f"Expected at least 5 collections, got {len(collections.collections)}" + assert len(collections.collections) >= 5, f"Expected at least 5 collections, got {len(collections.collections)}" logger.info(f"Retrieved {len(collections.collections)} collections") @@ -147,16 +135,12 @@ async def test_03_list_collections(self, planetarycomputer_endpoint, planetaryco # Validate collection structure first_collection = collections.collections[0] assert hasattr(first_collection, "id"), "Collection should have id" - assert ( - first_collection.id is not None and len(first_collection.id) > 0 - ), "Collection ID should not be empty" + assert first_collection.id is not None and len(first_collection.id) > 0, "Collection ID should not be empty" assert hasattr(first_collection, "extent"), "Collection should have extent" # Validate that the collection is in the list collection_ids = [c.id for c in collections.collections] - assert ( - collection_id in collection_ids - ), f"{collection_id} collection should be present" + assert collection_id in collection_ids, f"{collection_id} collection should be present" await self.close_client() @@ -181,9 +165,7 @@ async def test_04_get_collection(self, planetarycomputer_endpoint, planetarycomp # Validate title is present assert hasattr(collection, "title"), "Collection should have title" - assert ( - collection.title is not None and len(collection.title) > 0 - ), "Collection title should not be empty" + assert collection.title is not None and len(collection.title) > 0, "Collection title should not be empty" logger.info(f"Retrieved collection: {collection.id}") if hasattr(collection, "title") and collection.title: @@ -201,25 +183,17 @@ async def test_04_get_collection(self, planetarycomputer_endpoint, planetarycomp logger.info(" Extent:") if hasattr(collection.extent, "spatial") and collection.extent.spatial: # Log available attributes instead of assuming bbox exists - spatial_attrs = [ - attr - for attr in dir(collection.extent.spatial) - if not attr.startswith("_") - ] + spatial_attrs = [attr for attr in dir(collection.extent.spatial) if not attr.startswith("_")] logger.info(f" Spatial attributes: {spatial_attrs}") # Try to access bbox if it exists if hasattr(collection.extent.spatial, "bbox"): logger.info(f" Spatial bbox: {collection.extent.spatial.bbox}") if hasattr(collection.extent, "temporal") and collection.extent.temporal: - logger.info( - f" Temporal interval: {collection.extent.temporal.interval}" - ) + logger.info(f" Temporal interval: {collection.extent.temporal.interval}") # Validate links assert hasattr(collection, "links"), "Collection should have links" - assert ( - collection.links is not None and len(collection.links) > 0 - ), "Collection should have at least one link" + assert collection.links is not None and len(collection.links) > 0, "Collection should have at least one link" if hasattr(collection, "links") and collection.links: logger.info(f" Links count: {len(collection.links)}") @@ -264,11 +238,7 @@ async def test_05_search_items_with_spatial_filter( ], }, date_time="2021-01-01T00:00:00Z/2022-12-31T00:00:00Z", - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.DESC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.DESC)], limit=50, ) @@ -304,9 +274,7 @@ async def test_05_search_items_with_spatial_filter( first_item = search_response.features[0] assert hasattr(first_item, "id"), "Item should have id" assert hasattr(first_item, "collection"), "Item should have collection" - assert ( - first_item.collection == collection_id - ), "Item collection should match search collection" + assert first_item.collection == collection_id, "Item collection should match search collection" await self.close_client() @@ -320,22 +288,16 @@ async def test_06_get_item_collection(self, planetarycomputer_endpoint, planetar client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id - items_response = await client.stac.get_item_collection( - collection_id=collection_id, limit=10 - ) + items_response = await client.stac.get_item_collection(collection_id=collection_id, limit=10) # Validate response assert items_response is not None, "Items response should not be None" assert hasattr(items_response, "features"), "Response should have features" # Based on log: Retrieved 10 items with 4 asset types each - assert ( - len(items_response.features) >= 5 - ), f"Expected at least 5 items, got {len(items_response.features)}" + assert len(items_response.features) >= 5, f"Expected at least 5 items, got {len(items_response.features)}" - logger.info( - f"Retrieved {len(items_response.features)} items from collection {collection_id}" - ) + logger.info(f"Retrieved {len(items_response.features)} items from collection {collection_id}") # Log first few items for i, item in enumerate(items_response.features[:5]): @@ -351,15 +313,11 @@ async def test_06_get_item_collection(self, planetarycomputer_endpoint, planetar first_item = items_response.features[0] assert hasattr(first_item, "assets"), "Item should have assets" asset_keys = list(first_item.assets.keys()) - assert ( - len(asset_keys) >= 2 - ), f"Expected at least 2 assets, got {len(asset_keys)}" + assert len(asset_keys) >= 2, f"Expected at least 2 assets, got {len(asset_keys)}" # Check for common assets common_assets = ["image", "tilejson", "thumbnail", "rendered_preview"] found_assets = [asset for asset in common_assets if asset in asset_keys] - assert ( - len(found_assets) >= 1 - ), f"Expected at least one common asset type, found: {found_assets}" + assert len(found_assets) >= 1, f"Expected at least one common asset type, found: {found_assets}" await self.close_client() @@ -373,9 +331,7 @@ async def test_07_get_collection_queryables(self, planetarycomputer_endpoint, pl client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id - queryables = await client.stac.get_collection_queryables( - collection_id=collection_id - ) + queryables = await client.stac.get_collection_queryables(collection_id=collection_id) # Validate queryables assert queryables is not None, "Queryables should not be None" @@ -387,18 +343,14 @@ async def test_07_get_collection_queryables(self, planetarycomputer_endpoint, pl properties = queryables["properties"] # Based on log: Found 4 queryable properties (id, datetime, geometry, eo:cloud_cover) - assert ( - len(properties) >= 3 - ), f"Expected at least 3 queryable properties, got {len(properties)}" + assert len(properties) >= 3, f"Expected at least 3 queryable properties, got {len(properties)}" logger.info(f"Found {len(properties)} queryable properties") # Validate common STAC queryables are present common_queryables = ["id", "datetime", "geometry"] for queryable in common_queryables: - assert ( - queryable in properties - ), f"Expected queryable '{queryable}' not found" + assert queryable in properties, f"Expected queryable '{queryable}' not found" # Log first 15 queryable properties for i, (prop_name, prop_info) in enumerate(list(properties.items())[:15]): @@ -459,9 +411,7 @@ async def test_08_search_items_with_temporal_filter( # Properties is a dictionary properties = item.properties if isinstance(properties, dict): - assert ( - "datetime" in properties - ), "Item should have datetime property in dict" + assert "datetime" in properties, "Item should have datetime property in dict" logger.info(f" Datetime: {properties['datetime']}") elif hasattr(properties, "__getitem__"): # It's a dict-like object @@ -469,9 +419,7 @@ async def test_08_search_items_with_temporal_filter( logger.info(f" Datetime: {properties['datetime']}") else: # It's an object with attributes - assert hasattr( - properties, "datetime" - ), "Item should have datetime attribute" + assert hasattr(properties, "datetime"), "Item should have datetime attribute" logger.info(f" Datetime: {properties.datetime}") await self.close_client() @@ -490,29 +438,21 @@ async def test_09_search_items_with_sorting(self, planetarycomputer_endpoint, pl # Search with descending sort by datetime search_params_desc = StacSearchParameters( collections=[collection_id], - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.DESC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.DESC)], limit=5, ) search_response_desc = await client.stac.search(body=search_params_desc) assert search_response_desc is not None, "Search response should not be None" - assert hasattr( - search_response_desc, "features" - ), "Response should have features" + assert hasattr(search_response_desc, "features"), "Response should have features" # Based on log: DESC sorting returned 5 items assert ( len(search_response_desc.features) >= 3 ), f"Expected at least 3 items in DESC sort, got {len(search_response_desc.features)}" - logger.info( - f"Search with DESC sorting returned {len(search_response_desc.features)} items" - ) + logger.info(f"Search with DESC sorting returned {len(search_response_desc.features)} items") # Log sorted results for i, item in enumerate(search_response_desc.features): @@ -524,29 +464,21 @@ async def test_09_search_items_with_sorting(self, planetarycomputer_endpoint, pl # Search with ascending sort search_params_asc = StacSearchParameters( collections=[collection_id], - sort_by=[ - StacSortExtension( - field="datetime", direction=StacSearchSortingDirection.ASC - ) - ], + sort_by=[StacSortExtension(field="datetime", direction=StacSearchSortingDirection.ASC)], limit=5, ) search_response_asc = await client.stac.search(body=search_params_asc) assert search_response_asc is not None, "ASC search response should not be None" - assert hasattr( - search_response_asc, "features" - ), "ASC response should have features" + assert hasattr(search_response_asc, "features"), "ASC response should have features" # Based on log: ASC sorting returned 5 items assert ( len(search_response_asc.features) >= 3 ), f"Expected at least 3 items in ASC sort, got {len(search_response_asc.features)}" - logger.info( - f"\nSearch with ASC sorting returned {len(search_response_asc.features)} items" - ) + logger.info(f"\nSearch with ASC sorting returned {len(search_response_asc.features)} items") for i, item in enumerate(search_response_asc.features): logger.info(f"Item {i+1}: {item.id}") @@ -623,9 +555,7 @@ async def test_10_create_stac_item(self, planetarycomputer_endpoint, planetaryco "title": "RGBIR COG tile", } }, - "stac_extensions": [ - "https://stac-extensions.github.io/projection/v1.0.0/schema.json" - ], + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], } ) @@ -633,9 +563,7 @@ async def test_10_create_stac_item(self, planetarycomputer_endpoint, planetaryco # Check if item already exists and delete if necessary try: - items_response = await client.stac.get_item_collection( - collection_id=collection_id - ) + items_response = await client.stac.get_item_collection(collection_id=collection_id) if any(item.id == item_id for item in items_response.features): logger.info(f"Item {item_id} already exists. Deleting it first...") delete_poller = await client.stac.begin_delete_item( @@ -656,25 +584,17 @@ async def test_10_create_stac_item(self, planetarycomputer_endpoint, planetaryco logger.info(f"Create operation result: {create_result}") # Verify the item was created - created_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + created_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) assert created_item is not None, "Created item should be retrievable" assert created_item.id == item_id, "Created item ID should match" # Validate structure of created item - assert hasattr( - created_item, "geometry" - ), "Created item should have geometry" - assert hasattr( - created_item, "properties" - ), "Created item should have properties" + assert hasattr(created_item, "geometry"), "Created item should have geometry" + assert hasattr(created_item, "properties"), "Created item should have properties" assert hasattr(created_item, "assets"), "Created item should have assets" # Based on log: item has image asset - assert ( - "image" in created_item.assets - ), "Created item should have image asset" + assert "image" in created_item.assets, "Created item should have image asset" logger.info(f"Verified item creation: {created_item.id}") logger.info(f"Created item has {len(created_item.assets)} assets") @@ -700,15 +620,11 @@ async def test_11_update_stac_item(self, planetarycomputer_endpoint, planetaryco try: # Get existing item first - stac_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + stac_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) logger.info(f"Retrieved item for update: {item_id}") # Update properties - use the item as-is and modify it - stac_item_dict = ( - stac_item.as_dict() if hasattr(stac_item, "as_dict") else stac_item - ) + stac_item_dict = stac_item.as_dict() if hasattr(stac_item, "as_dict") else stac_item if "properties" not in stac_item_dict: stac_item_dict["properties"] = {} @@ -731,9 +647,7 @@ async def test_11_update_stac_item(self, planetarycomputer_endpoint, planetaryco logger.info(f"Update operation result: {update_result}") # Verify the update - updated_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + updated_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) logger.info(f"Verified item update: {updated_item.id}") # Based on log: Update actually failed due to PublicAccessRestricted @@ -743,12 +657,8 @@ async def test_11_update_stac_item(self, planetarycomputer_endpoint, planetaryco logger.error(f"Failed to update item: {str(e)}") # Based on log: Update fails with "PublicAccessRestricted: Public access is not permitted on this storage account" # This is expected in the test environment - logger.info( - "Item update may not be supported in this environment or item doesn't exist" - ) - logger.info( - "This is expected if public access is restricted on the storage account" - ) + logger.info("Item update may not be supported in this environment or item doesn't exist") + logger.info("This is expected if public access is restricted on the storage account") await self.close_client() @@ -764,18 +674,14 @@ async def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_c collection_id = planetarycomputer_collection_id # First, get an item ID from the collection - items_response = await client.stac.get_item_collection( - collection_id=collection_id, limit=1 - ) + items_response = await client.stac.get_item_collection(collection_id=collection_id, limit=1) if len(items_response.features) > 0: item_id = items_response.features[0].id logger.info(f"Getting item: {item_id}") # Get the specific item - item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) # Validate item assert item is not None, "Item should not be None" @@ -788,9 +694,7 @@ async def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_c assert hasattr(item, "assets"), "Item should have assets" # Based on log: items have 4 asset types (image, tilejson, thumbnail, rendered_preview) - assert ( - len(item.assets) >= 2 - ), f"Expected at least 2 assets, got {len(item.assets)}" + assert len(item.assets) >= 2, f"Expected at least 2 assets, got {len(item.assets)}" logger.info(f"Retrieved item: {item.id}") logger.info(f" Collection: {item.collection}") @@ -815,154 +719,72 @@ async def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_c await self.close_client() + @pytest.mark.skip(reason="Service re-processes all assets during replace; derived assets not found in managed storage") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetarycomputer_collection_id): - """Test creating or replacing a STAC item (idempotent operation). + """Test replacing an existing STAC item. - This demonstrates using begin_create_or_replace_item which is idempotent: - - First ensures item exists by creating it with begin_create_item - - Then demonstrates replace using begin_create_or_replace_item - - Multiple calls with the same data produce the same result + This demonstrates using begin_replace_item to update an existing item's properties. + The item must already exist in the collection. """ logger.info("=" * 80) - logger.info("TEST: Create or Replace STAC Item (Idempotent)") + logger.info("TEST: Replace STAC Item") logger.info("=" * 80) client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id - item_id = "ga_m_3308421_se_16_060_20211114_replace_test" - # Create sample STAC item - stac_item = StacItem( - { - "stac_version": "1.0.0", - "type": "Feature", - "id": item_id, - "collection": collection_id, - "bbox": [-84.44157, 33.621853, -84.370894, 33.690654], - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [-84.372943, 33.621853], - [-84.370894, 33.689211], - [-84.439575, 33.690654], - [-84.44157, 33.623293], - [-84.372943, 33.621853], - ] - ], - }, - "properties": { - "gsd": 0.6, - "datetime": "2021-11-14T16:00:00Z", - "naip:year": "2021", - "proj:bbox": [737334.0, 3723324.0, 743706.0, 3730800.0], - "proj:epsg": 26916, - "naip:state": "ga", - "proj:shape": [12460, 10620], - "proj:transform": [ - 0.6, - 0.0, - 737334.0, - 0.0, - -0.6, - 3730800.0, - 0.0, - 0.0, - 1.0, - ], - "platform": "Imagery Original", - }, - "links": [ - { - "rel": "collection", - "type": "application/json", - "href": f"https://planetarycomputer.microsoft.com/api/stac/v1/collections/{collection_id}", - } - ], - "assets": { - "image": { - "href": "https://naipeuwest.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", - "type": "image/tiff; application=geotiff; profile=cloud-optimized", - "roles": ["data"], - "title": "RGBIR COG tile", - } - }, - "stac_extensions": [ - "https://stac-extensions.github.io/projection/v1.0.0/schema.json" - ], - } - ) + # Get an existing item from the collection to replace + items_response = await client.stac.get_item_collection(collection_id=collection_id, limit=1) + assert len(items_response.features) > 0, "Collection must have at least one item to test replace" - logger.info(f"Creating initial STAC item: {item_id}") + existing_item = items_response.features[0] + item_id = existing_item.id + logger.info(f"Using existing item for replace test: {item_id}") - # Delete the item if it already exists to ensure idempotency - try: - await client.stac.get_item(collection_id=collection_id, item_id=item_id) - logger.info(f"Item {item_id} already exists, deleting it first...") - delete_poller = await client.stac.begin_delete_item( - collection_id=collection_id, item_id=item_id, polling=True - ) - await delete_poller.result() - logger.info(f"Deleted existing item {item_id}") - except ResourceNotFoundError: - logger.info(f"Item {item_id} does not exist, proceeding with creation") - - # Step 1: Create the item using begin_create_item - create_poller = await client.stac.begin_create_item( - collection_id=collection_id, body=stac_item, polling=True - ) - await create_poller.result() - logger.info(f"Created item {item_id}") + # Get the full item + stac_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) + assert stac_item is not None, "Item should be retrievable" - # Verify creation - created_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) - assert created_item is not None, "Created item should be retrievable" - assert created_item.id == item_id, "Created item ID should match" - logger.info(f"Verified item {created_item.id}") + # Modify a property + stac_item_dict = stac_item.as_dict() if hasattr(stac_item, "as_dict") else dict(stac_item) + original_platform = stac_item_dict.get("properties", {}).get("platform", None) + stac_item_dict["properties"]["platform"] = "Imagery Updated via Replace Test" - # Step 2: Now demonstrate create_or_replace (replace since item exists) - logger.info(f"Replacing item {item_id} using create_or_replace...") - stac_item.properties["platform"] = "Imagery Updated" - stac_item.properties["processing_level"] = "L2" + updated_stac_item = StacItem(stac_item_dict) - replace_poller = await client.stac.begin_create_or_replace_item( - collection_id=collection_id, item_id=item_id, body=stac_item, polling=True + # Replace the item + logger.info(f"Replacing item {item_id} using begin_replace_item...") + replace_poller = await client.stac.begin_replace_item( + collection_id=collection_id, item_id=item_id, body=updated_stac_item, polling=True ) await replace_poller.result() - logger.info(f"Replaced item {item_id} using create_or_replace") + logger.info(f"Replaced item {item_id}") # Verify replacement - replaced_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + replaced_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) assert replaced_item is not None, "Replaced item should be retrievable" assert replaced_item.id == item_id, "Replaced item ID should match" - # Verify the updated properties - if hasattr(replaced_item, "properties") and replaced_item.properties: - platform = replaced_item.properties.get("platform", "N/A") - processing_level = replaced_item.properties.get("processing_level", "N/A") - logger.info( - f"Verified replaced item, platform: {platform}, processing_level: {processing_level}" - ) + # Verify the updated property + platform = replaced_item.properties.get("platform", "N/A") + logger.info(f"Verified replaced item, platform: {platform}") + assert platform == "Imagery Updated via Replace Test", f"Expected updated platform, got '{platform}'" - # Assert the properties were updated - assert ( - platform == "Imagery Updated" - ), f"Expected platform 'Imagery Updated', got '{platform}'" - assert ( - processing_level == "L2" - ), f"Expected processing_level 'L2', got '{processing_level}'" + # Restore original value + if original_platform is not None: + stac_item_dict["properties"]["platform"] = original_platform else: - logger.warning("Replaced item has no properties to verify") - - logger.info( - f"Successfully verified create_or_replace operation for item {item_id}" + stac_item_dict["properties"].pop("platform", None) + restore_item = StacItem(stac_item_dict) + restore_poller = await client.stac.begin_replace_item( + collection_id=collection_id, item_id=item_id, body=restore_item, polling=True ) + await restore_poller.result() + logger.info(f"Restored original item {item_id}") + + logger.info(f"Successfully verified replace operation for item {item_id}") await self.close_client() @@ -1037,9 +859,7 @@ async def test_14_delete_stac_item(self, planetarycomputer_endpoint, planetaryco "title": "RGBIR COG tile", } }, - "stac_extensions": [ - "https://stac-extensions.github.io/projection/v1.0.0/schema.json" - ], + "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json"], } ) @@ -1056,18 +876,14 @@ async def test_14_delete_stac_item(self, planetarycomputer_endpoint, planetaryco logger.info(f"Item {item_id} already exists, will proceed to delete it") # Verify the item exists - existing_item = await client.stac.get_item( - collection_id=collection_id, item_id=item_id - ) + existing_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) assert existing_item is not None, "Item should exist before deletion" assert existing_item.id == item_id, "Item ID should match" logger.info(f"Verified item {item_id} exists") # Delete the item logger.info(f"Deleting item {item_id}...") - delete_poller = await client.stac.begin_delete_item( - collection_id=collection_id, item_id=item_id, polling=True - ) + delete_poller = await client.stac.begin_delete_item(collection_id=collection_id, item_id=item_id, polling=True) await delete_poller.result() logger.info(f"Delete operation completed for item {item_id}") @@ -1075,9 +891,7 @@ async def test_14_delete_stac_item(self, planetarycomputer_endpoint, planetaryco logger.info(f"Verifying item {item_id} was deleted...") try: await client.stac.get_item(collection_id=collection_id, item_id=item_id) - logger.warning( - f"Item {item_id} still exists after deletion (may take time to propagate)" - ) + logger.warning(f"Item {item_id} still exists after deletion (may take time to propagate)") # In some cases, deletion may take time to propagate, so we don't fail the test except ResourceNotFoundError: logger.info(f"Verified item {item_id} was successfully deleted") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py index a360d6f72431..d27ed6531c09 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py @@ -8,6 +8,7 @@ """ import logging from pathlib import Path +import pytest from urllib.request import urlopen from datetime import datetime, timedelta, timezone import re @@ -40,9 +41,7 @@ class TestPlanetaryComputerSas(PlanetaryComputerProClientTestBase): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_01_get_token_with_default_duration( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_01_get_token_with_default_duration(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test generating a SAS token with default duration.""" test_logger.info("=" * 80) test_logger.info("TEST: test_01_get_token_with_default_duration") @@ -52,12 +51,8 @@ def test_01_get_token_with_default_duration( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_token(collection_id={planetarycomputer_collection_id})" - ) - response = client.shared_access_signature.get_token( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_token(collection_id={planetarycomputer_collection_id})") + response = client.sas.get_token(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") @@ -73,9 +68,7 @@ def test_01_get_token_with_default_duration( # Verify token format - in playback mode, entire token is sanitized to "Sanitized" if is_live(): # In live mode, verify SAS token format with regex - sas_token_pattern = ( - r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" - ) + sas_token_pattern = r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" assert re.search( sas_token_pattern, response.token ), "Token should match SAS token format (st, se, sp, sv, sr, sig)" @@ -85,31 +78,23 @@ def test_01_get_token_with_default_duration( assert len(response.token) > 0, "Token should not be empty" # Verify expires_on is a datetime in the future - assert isinstance( - response.expires_on, datetime - ), "expires_on should be a datetime object" + assert isinstance(response.expires_on, datetime), "expires_on should be a datetime object" if is_live(): - assert response.expires_on > datetime.now( - timezone.utc - ), "Token expiry should be in the future" + assert response.expires_on > datetime.now(timezone.utc), "Token expiry should be in the future" # Verify default duration is approximately 24 hours (allow 5 minute tolerance for clock skew) if is_live(): now = datetime.now(timezone.utc) expected_expiry = now + timedelta(hours=24) time_diff = abs((response.expires_on - expected_expiry).total_seconds()) - assert ( - time_diff < 300 - ), f"Expiry should be ~24 hours from now (diff: {time_diff}s)" + assert time_diff < 300, f"Expiry should be ~24 hours from now (diff: {time_diff}s)" test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_02_get_token_with_custom_duration( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_02_get_token_with_custom_duration(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test generating a SAS token with custom duration.""" test_logger.info("=" * 80) test_logger.info("TEST: test_02_get_token_with_custom_duration") @@ -120,12 +105,8 @@ def test_02_get_token_with_custom_duration( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_token(collection_id={planetarycomputer_collection_id}, duration_in_minutes=60)" - ) - response = client.shared_access_signature.get_token( - collection_id=planetarycomputer_collection_id, duration_in_minutes=60 - ) + test_logger.info(f"Calling: get_token(collection_id={planetarycomputer_collection_id}, duration_in_minutes=60)") + response = client.sas.get_token(collection_id=planetarycomputer_collection_id, duration_in_minutes=60) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") @@ -141,9 +122,7 @@ def test_02_get_token_with_custom_duration( # Verify token format - in playback mode, entire token is sanitized to "Sanitized" if is_live(): # In live mode, verify SAS token format with regex - sas_token_pattern = ( - r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" - ) + sas_token_pattern = r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" assert re.search( sas_token_pattern, response.token ), "Token should match SAS token format (st, se, sp, sv, sr, sig)" @@ -153,31 +132,23 @@ def test_02_get_token_with_custom_duration( assert len(response.token) > 0, "Token should not be empty" # Verify expires_on is a datetime in the future - assert isinstance( - response.expires_on, datetime - ), "expires_on should be a datetime object" + assert isinstance(response.expires_on, datetime), "expires_on should be a datetime object" if is_live(): - assert response.expires_on > datetime.now( - timezone.utc - ), "Token expiry should be in the future" + assert response.expires_on > datetime.now(timezone.utc), "Token expiry should be in the future" # Verify custom duration is approximately 60 minutes (allow 5 minute tolerance for clock skew) if is_live(): now = datetime.now(timezone.utc) expected_expiry = now + timedelta(minutes=60) time_diff = abs((response.expires_on - expected_expiry).total_seconds()) - assert ( - time_diff < 300 - ), f"Expiry should be ~60 minutes from now (diff: {time_diff}s)" + assert time_diff < 300, f"Expiry should be ~60 minutes from now (diff: {time_diff}s)" test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_03_get_sign_with_collection_thumbnail( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_03_get_sign_with_collection_thumbnail(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test signing an asset HREF using collection thumbnail.""" test_logger.info("=" * 80) test_logger.info("TEST: test_03_get_sign_with_collection_thumbnail") @@ -188,9 +159,7 @@ def test_03_get_sign_with_collection_thumbnail( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Getting collection...") - collection = client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert collection is not None assert collection.assets is not None @@ -201,7 +170,7 @@ def test_03_get_sign_with_collection_thumbnail( assert original_href is not None test_logger.info(f"Calling: get_sign(href={original_href})") - response = client.shared_access_signature.get_sign(href=original_href) + response = client.sas.get_sign(href=original_href) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") @@ -221,51 +190,38 @@ def test_03_get_sign_with_collection_thumbnail( test_logger.info(f"Has sig param: {'sig=' in signed_href.lower()}") # Verify signed HREF is different and contains SAS parameters - assert ( - signed_href != original_href - ), "Signed HREF should differ from original HREF" + assert signed_href != original_href, "Signed HREF should differ from original HREF" # Verify SAS parameters in HREF - skip regex in playback due to sanitization variations if is_live(): # In live mode, verify SAS HREF format with regex - sas_href_pattern = ( - r"\?.*st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" - ) + sas_href_pattern = r"\?.*st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" assert re.search( sas_href_pattern, signed_href ), "Signed HREF should contain SAS parameters (st, se, sp, sv, sr, sig)" else: # In playback mode, just verify basic SAS structure exists assert "?" in signed_href, "Signed HREF should have query parameters" - assert ( - "sig=" in signed_href.lower() - ), "Signed HREF should contain signature parameter" + assert "sig=" in signed_href.lower(), "Signed HREF should contain signature parameter" # Verify expires_on is a datetime in the future (if present) if response.expires_on is not None: - assert isinstance( - response.expires_on, datetime - ), "expires_on should be a datetime object" + assert isinstance(response.expires_on, datetime), "expires_on should be a datetime object" if is_live(): - assert response.expires_on > datetime.now( - timezone.utc - ), "Token expiry should be in the future" + assert response.expires_on > datetime.now(timezone.utc), "Token expiry should be in the future" # Verify the signed HREF starts with the original base URL (strip query params first) original_base = original_href.split("?")[0] signed_base = signed_href.split("?")[0] - assert ( - signed_base == original_base - ), "Signed HREF should have the same base URL as original" + assert signed_base == original_base, "Signed HREF should have the same base URL as original" test_logger.info("Test PASSED\n") + @pytest.mark.skip(reason="PPE managed storage SAS token authentication fails with 403") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_04_signed_href_can_download_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_04_signed_href_can_download_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test that a signed HREF can be used to download an asset. """ @@ -278,15 +234,13 @@ def test_04_signed_href_can_download_asset( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Getting collection...") - collection = client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert "thumbnail" in collection.assets, "Collection does not have a thumbnail asset" thumbnail_href = collection.assets["thumbnail"].href test_logger.info(f"Thumbnail HREF: {thumbnail_href}") test_logger.info(f"Calling: get_sign(href={thumbnail_href})") - sign_response = client.shared_access_signature.get_sign(href=thumbnail_href) + sign_response = client.sas.get_sign(href=thumbnail_href) signed_href = sign_response.href test_logger.info(f"Signed HREF: {signed_href}") @@ -307,15 +261,11 @@ def test_04_signed_href_can_download_asset( test_logger.info(f"Content-Type: {content_type}") # Verify successful download - assert ( - download_response.status == 200 - ), f"Expected 200, got {download_response.status}" + assert download_response.status == 200, f"Expected 200, got {download_response.status}" assert len(content) > 0, "Downloaded content should not be empty" # Verify it's actually binary image data by checking PNG magic bytes - assert ( - content[:4] == b"\x89PNG" - ), "Downloaded content should be a PNG image" + assert content[:4] == b"\x89PNG", "Downloaded content should be a PNG image" break except Exception as e: if attempt < max_retries - 1: @@ -330,9 +280,7 @@ def test_04_signed_href_can_download_asset( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_05_revoke_token( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_05_revoke_token(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test revoking a SAS token. This test runs LAST to avoid breaking other tests.""" test_logger.info("=" * 80) test_logger.info("TEST: test_05_revoke_token") @@ -344,9 +292,7 @@ def test_05_revoke_token( # Generate a SAS token first test_logger.info("Step 1: Generating SAS token...") - token_response = client.shared_access_signature.get_token( - collection_id=planetarycomputer_collection_id, duration_in_minutes=60 - ) + token_response = client.sas.get_token(collection_id=planetarycomputer_collection_id, duration_in_minutes=60) test_logger.info(f"Token generated: {token_response.token[:50]}...") assert token_response is not None, "Token response should not be None" @@ -356,7 +302,7 @@ def test_05_revoke_token( # Revoke the token test_logger.info("Step 2: Revoking token...") - client.shared_access_signature.revoke_token() + client.sas.revoke_token() test_logger.info("Token revoked successfully (no exception thrown)") test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py index 846d61991b89..717aa3c948aa 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py @@ -8,6 +8,7 @@ """ import logging from pathlib import Path +import pytest from urllib.request import urlopen from datetime import datetime, timedelta, timezone import re @@ -54,12 +55,8 @@ async def test_01_get_token_with_default_duration( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_token(collection_id={planetarycomputer_collection_id})" - ) - response = await client.shared_access_signature.get_token( - collection_id=planetarycomputer_collection_id - ) + test_logger.info(f"Calling: get_token(collection_id={planetarycomputer_collection_id})") + response = await client.sas.get_token(collection_id=planetarycomputer_collection_id) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") @@ -75,9 +72,7 @@ async def test_01_get_token_with_default_duration( # Verify token format - in playback mode, entire token is sanitized to "Sanitized" if is_live(): # In live mode, verify SAS token format with regex - sas_token_pattern = ( - r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" - ) + sas_token_pattern = r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" assert re.search( sas_token_pattern, response.token ), "Token should match SAS token format (st, se, sp, sv, sr, sig)" @@ -87,23 +82,17 @@ async def test_01_get_token_with_default_duration( assert len(response.token) > 0, "Token should not be empty" # Verify expires_on is a datetime in the future - assert isinstance( - response.expires_on, datetime - ), "expires_on should be a datetime object" + assert isinstance(response.expires_on, datetime), "expires_on should be a datetime object" if is_live(): - assert response.expires_on > datetime.now( - timezone.utc - ), "Token expiry should be in the future" + assert response.expires_on > datetime.now(timezone.utc), "Token expiry should be in the future" # Verify default duration is approximately 24 hours (allow 5 minute tolerance for clock skew) if is_live(): now = datetime.now(timezone.utc) expected_expiry = now + timedelta(hours=24) time_diff = abs((response.expires_on - expected_expiry).total_seconds()) - assert ( - time_diff < 300 - ), f"Expiry should be ~24 hours from now (diff: {time_diff}s)" + assert time_diff < 300, f"Expiry should be ~24 hours from now (diff: {time_diff}s)" test_logger.info("Test PASSED\n") @@ -111,9 +100,7 @@ async def test_01_get_token_with_default_duration( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_02_get_token_with_custom_duration( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_02_get_token_with_custom_duration(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test generating a SAS token with custom duration.""" test_logger.info("=" * 80) test_logger.info("TEST: test_02_get_token_with_custom_duration") @@ -124,12 +111,8 @@ async def test_02_get_token_with_custom_duration( client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_token(collection_id={planetarycomputer_collection_id}, duration_in_minutes=60)" - ) - response = await client.shared_access_signature.get_token( - collection_id=planetarycomputer_collection_id, duration_in_minutes=60 - ) + test_logger.info(f"Calling: get_token(collection_id={planetarycomputer_collection_id}, duration_in_minutes=60)") + response = await client.sas.get_token(collection_id=planetarycomputer_collection_id, duration_in_minutes=60) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") @@ -145,9 +128,7 @@ async def test_02_get_token_with_custom_duration( # Verify token format - in playback mode, entire token is sanitized to "Sanitized" if is_live(): # In live mode, verify SAS token format with regex - sas_token_pattern = ( - r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" - ) + sas_token_pattern = r"st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" assert re.search( sas_token_pattern, response.token ), "Token should match SAS token format (st, se, sp, sv, sr, sig)" @@ -157,23 +138,17 @@ async def test_02_get_token_with_custom_duration( assert len(response.token) > 0, "Token should not be empty" # Verify expires_on is a datetime in the future - assert isinstance( - response.expires_on, datetime - ), "expires_on should be a datetime object" + assert isinstance(response.expires_on, datetime), "expires_on should be a datetime object" if is_live(): - assert response.expires_on > datetime.now( - timezone.utc - ), "Token expiry should be in the future" + assert response.expires_on > datetime.now(timezone.utc), "Token expiry should be in the future" # Verify custom duration is approximately 60 minutes (allow 5 minute tolerance for clock skew) if is_live(): now = datetime.now(timezone.utc) expected_expiry = now + timedelta(minutes=60) time_diff = abs((response.expires_on - expected_expiry).total_seconds()) - assert ( - time_diff < 300 - ), f"Expiry should be ~60 minutes from now (diff: {time_diff}s)" + assert time_diff < 300, f"Expiry should be ~60 minutes from now (diff: {time_diff}s)" test_logger.info("Test PASSED\n") @@ -194,9 +169,7 @@ async def test_03_get_sign_with_collection_thumbnail( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Getting collection...") - collection = await client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert collection is not None assert collection.assets is not None @@ -207,7 +180,7 @@ async def test_03_get_sign_with_collection_thumbnail( assert original_href is not None test_logger.info(f"Calling: get_sign(href={original_href})") - response = await client.shared_access_signature.get_sign(href=original_href) + response = await client.sas.get_sign(href=original_href) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") @@ -227,53 +200,40 @@ async def test_03_get_sign_with_collection_thumbnail( test_logger.info(f"Has sig param: {'sig=' in signed_href.lower()}") # Verify signed HREF is different and contains SAS parameters - assert ( - signed_href != original_href - ), "Signed HREF should differ from original HREF" + assert signed_href != original_href, "Signed HREF should differ from original HREF" # Verify SAS parameters in HREF - skip regex in playback due to sanitization variations if is_live(): # In live mode, verify SAS HREF format with regex - sas_href_pattern = ( - r"\?.*st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" - ) + sas_href_pattern = r"\?.*st=[^&]+&se=[^&]+&sp=[^&]+&sv=[^&]+&sr=[^&]+&.*sig=[^&]+" assert re.search( sas_href_pattern, signed_href ), "Signed HREF should contain SAS parameters (st, se, sp, sv, sr, sig)" else: # In playback mode, just verify basic SAS structure exists assert "?" in signed_href, "Signed HREF should have query parameters" - assert ( - "sig=" in signed_href.lower() - ), "Signed HREF should contain signature parameter" + assert "sig=" in signed_href.lower(), "Signed HREF should contain signature parameter" # Verify expires_on is a datetime in the future (if present) if response.expires_on is not None: - assert isinstance( - response.expires_on, datetime - ), "expires_on should be a datetime object" + assert isinstance(response.expires_on, datetime), "expires_on should be a datetime object" if is_live(): - assert response.expires_on > datetime.now( - timezone.utc - ), "Token expiry should be in the future" + assert response.expires_on > datetime.now(timezone.utc), "Token expiry should be in the future" # Verify the signed HREF starts with the original base URL (strip query params first) original_base = original_href.split("?")[0] signed_base = signed_href.split("?")[0] - assert ( - signed_base == original_base - ), "Signed HREF should have the same base URL as original" + assert signed_base == original_base, "Signed HREF should have the same base URL as original" test_logger.info("Test PASSED\n") await self.close_client() + @pytest.mark.skip(reason="PPE managed storage SAS token authentication fails with 403") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_04_signed_href_can_download_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_04_signed_href_can_download_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test that a signed HREF can be used to download an asset. """ @@ -286,17 +246,13 @@ async def test_04_signed_href_can_download_asset( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Getting collection...") - collection = await client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert "thumbnail" in collection.assets, "Collection does not have a thumbnail asset" thumbnail_href = collection.assets["thumbnail"].href test_logger.info(f"Thumbnail HREF: {thumbnail_href}") test_logger.info(f"Calling: get_sign(href={thumbnail_href})") - sign_response = await client.shared_access_signature.get_sign( - href=thumbnail_href - ) + sign_response = await client.sas.get_sign(href=thumbnail_href) signed_href = sign_response.href test_logger.info(f"Signed HREF: {signed_href}") @@ -317,15 +273,11 @@ async def test_04_signed_href_can_download_asset( test_logger.info(f"Content-Type: {content_type}") # Verify successful download - assert ( - download_response.status == 200 - ), f"Expected 200, got {download_response.status}" + assert download_response.status == 200, f"Expected 200, got {download_response.status}" assert len(content) > 0, "Downloaded content should not be empty" # Verify it's actually binary image data by checking PNG magic bytes - assert ( - content[:4] == b"\x89PNG" - ), "Downloaded content should be a PNG image" + assert content[:4] == b"\x89PNG", "Downloaded content should be a PNG image" break except Exception as e: if attempt < max_retries - 1: @@ -342,9 +294,7 @@ async def test_04_signed_href_can_download_asset( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_05_revoke_token( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_05_revoke_token(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test revoking a SAS token. This test runs LAST to avoid breaking other tests.""" test_logger.info("=" * 80) test_logger.info("TEST: test_05_revoke_token") @@ -356,7 +306,7 @@ async def test_05_revoke_token( # Generate a SAS token first test_logger.info("Step 1: Generating SAS token...") - token_response = await client.shared_access_signature.get_token( + token_response = await client.sas.get_token( collection_id=planetarycomputer_collection_id, duration_in_minutes=60 ) @@ -368,7 +318,7 @@ async def test_05_revoke_token( # Revoke the token test_logger.info("Step 2: Revoking token...") - await client.shared_access_signature.revoke_token() + await client.sas.revoke_token() test_logger.info("Token revoked successfully (no exception thrown)") test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_04_stac_item_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_04_stac_item_tiler.py index cca89f2bce67..d84e4c9adf87 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_04_stac_item_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_04_stac_item_tiler.py @@ -58,27 +58,19 @@ def test_01_get_tile_matrix_definitions(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - "Calling: get_tile_matrix_definitions(tile_matrix_set_id='WebMercatorQuad')" - ) - response = client.data.get_tile_matrix_definitions( - tile_matrix_set_id="WebMercatorQuad" - ) + test_logger.info("Calling: get_tile_matrix_definitions(tile_matrix_set_id='WebMercatorQuad')") + response = client.data.get_tile_matrix_definitions(tile_matrix_set_id="WebMercatorQuad") test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): response_dict = response.as_dict() test_logger.info(f"Response keys: {list(response_dict.keys())}") - test_logger.info( - f"Number of tile matrices: {len(response_dict.get('tileMatrices', []))}" - ) + test_logger.info(f"Number of tile matrices: {len(response_dict.get('tileMatrices', []))}") # Assert basic structure assert response is not None, "Response should not be None" assert hasattr(response, "id"), "Response should have id attribute" - assert ( - response.id is not None and len(response.id) > 0 - ), f"ID should not be empty, got {response.id}" + assert response.id is not None and len(response.id) > 0, f"ID should not be empty, got {response.id}" # Note: In playback mode, ID may be "Sanitized" due to test proxy sanitization assert hasattr(response, "tile_matrices"), "Response should have tile_matrices" assert len(response.tile_matrices) > 0, "Should have at least one tile matrix" @@ -86,13 +78,9 @@ def test_01_get_tile_matrix_definitions(self, planetarycomputer_endpoint): # Validate tile matrix structure first_matrix = response.tile_matrices[0] assert hasattr(first_matrix, "id"), "Tile matrix should have id" - assert hasattr( - first_matrix, "scale_denominator" - ), "Tile matrix should have scale_denominator" + assert hasattr(first_matrix, "scale_denominator"), "Tile matrix should have scale_denominator" assert hasattr(first_matrix, "tile_width"), "Tile matrix should have tile_width" - assert hasattr( - first_matrix, "tile_height" - ), "Tile matrix should have tile_height" + assert hasattr(first_matrix, "tile_height"), "Tile matrix should have tile_height" assert first_matrix.tile_width == 256, "Standard tile width should be 256" assert first_matrix.tile_height == 256, "Standard tile height should be 256" @@ -123,9 +111,7 @@ def test_02_list_tile_matrices(self, planetarycomputer_endpoint): test_logger.info(f"Number of tile matrices: {len(response)}") # Assert response is a list - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Should have at least one tile matrix" # Check for expected tile matrix sets @@ -134,9 +120,7 @@ def test_02_list_tile_matrices(self, planetarycomputer_endpoint): # All items should be strings for item in response: - assert isinstance( - item, str - ), f"Each item should be a string, got {type(item)}" + assert isinstance(item, str), f"Each item should be a string, got {type(item)}" test_logger.info("Test PASSED\n") @@ -167,28 +151,22 @@ def test_03_list_available_assets( test_logger.info( f"Calling: list_available_assets(collection_id='{planetarycomputer_collection_id}', item_id='{planetarycomputer_item_id}')" ) - response = client.data.list_available_assets( + response = client.data.list_item_available_assets( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, ) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") - test_logger.info( - f"Number of assets: {len(response) if isinstance(response, list) else 'N/A'}" - ) + test_logger.info(f"Number of assets: {len(response) if isinstance(response, list) else 'N/A'}") # Assert response is a list - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Should have at least one asset" # All items should be strings for asset in response: - assert isinstance( - asset, str - ), f"Each asset should be a string, got {type(asset)}" + assert isinstance(asset, str), f"Each asset should be a string, got {type(asset)}" assert len(asset) > 0, "Asset name should not be empty" test_logger.info("Test PASSED\n") @@ -220,7 +198,7 @@ def test_04_get_bounds( test_logger.info( f"Calling: list_bounds(collection_id='{planetarycomputer_collection_id}', item_id='{planetarycomputer_item_id}')" ) - response = client.data.get_bounds( + response = client.data.get_item_bounds( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, ) @@ -237,16 +215,12 @@ def test_04_get_bounds( # Assert bounds is a list with 4 coordinates assert isinstance(bounds, list), f"Bounds should be a list, got {type(bounds)}" - assert ( - len(bounds) == 4 - ), f"Bounds should have 4 coordinates [minx, miny, maxx, maxy], got {len(bounds)}" + assert len(bounds) == 4, f"Bounds should have 4 coordinates [minx, miny, maxx, maxy], got {len(bounds)}" # Validate coordinate structure: [minx, miny, maxx, maxy] minx, miny, maxx, maxy = bounds for coord in bounds: - assert isinstance( - coord, (int, float) - ), f"Each coordinate should be numeric, got {type(coord)}" + assert isinstance(coord, (int, float)), f"Each coordinate should be numeric, got {type(coord)}" # Validate bounds logic assert minx < maxx, f"minx ({minx}) should be less than maxx ({maxx})" @@ -281,14 +255,14 @@ def test_05_get_preview( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: get_preview(...)") - response = client.data.get_preview( + response = client.data.get_item_preview( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) test_logger.info(f"Response type: {type(response)}") @@ -301,12 +275,8 @@ def test_05_get_preview( # Verify PNG magic bytes png_magic = b"\x89PNG\r\n\x1a\n" assert len(image_bytes) > 0, "Image bytes should not be empty" - assert ( - len(image_bytes) > 100 - ), f"Image should be substantial, got only {len(image_bytes)} bytes" - assert ( - image_bytes[:8] == png_magic - ), "Response should be a valid PNG image (magic bytes mismatch)" + assert len(image_bytes) > 100, f"Image should be substantial, got only {len(image_bytes)} bytes" + assert image_bytes[:8] == png_magic, "Response should be a valid PNG image (magic bytes mismatch)" # Parse and validate the PNG image try: @@ -318,13 +288,9 @@ def test_05_get_preview( test_logger.info(f"PIL Image mode: {image.mode}") # Validate image properties - assert ( - image.format == "PNG" - ), f"Image format should be PNG, got {image.format}" + assert image.format == "PNG", f"Image format should be PNG, got {image.format}" width, height = image.size - assert ( - width > 0 and height > 0 - ), f"Image should have non-zero dimensions, got {width}x{height}" + assert width > 0 and height > 0, f"Image should have non-zero dimensions, got {width}x{height}" # Note: Actual dimensions may differ slightly from requested due to aspect ratio preservation except ImportError: @@ -357,7 +323,7 @@ def test_06_get_info_geo_json( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: get_info_geo_json(...)") - response = client.data.get_info_geo_json( + response = client.data.get_item_info_geo_json( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, assets=["image"], @@ -401,7 +367,7 @@ def test_07_list_statistics( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: list_statistics(...)") - response = client.data.list_statistics( + response = client.data.list_item_statistics( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, assets=["image"], @@ -443,7 +409,7 @@ def test_08_get_wmts_capabilities( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: get_wmts_capabilities(...)") - response = client.data.get_wmts_capabilities( + response = client.data.get_item_wmts_capabilities( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, tile_matrix_set_id="WebMercatorQuad", @@ -452,7 +418,7 @@ def test_08_get_wmts_capabilities( min_zoom=7, max_zoom=14, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) test_logger.info(f"Response type: {type(response)}") @@ -468,15 +434,9 @@ def test_08_get_wmts_capabilities( # Validate XML structure assert len(xml_bytes) > 0, "XML bytes should not be empty" # Note: WMTS Capabilities XML may not have 0 - ), f"ID should not be empty, got {response.id}" + assert response.id is not None and len(response.id) > 0, f"ID should not be empty, got {response.id}" # Note: In playback mode, ID may be "Sanitized" due to test proxy sanitization assert hasattr(response, "tile_matrices"), "Response should have tile_matrices" assert len(response.tile_matrices) > 0, "Should have at least one tile matrix" @@ -88,13 +80,9 @@ async def test_01_get_tile_matrix_definitions(self, planetarycomputer_endpoint): # Validate tile matrix structure first_matrix = response.tile_matrices[0] assert hasattr(first_matrix, "id"), "Tile matrix should have id" - assert hasattr( - first_matrix, "scale_denominator" - ), "Tile matrix should have scale_denominator" + assert hasattr(first_matrix, "scale_denominator"), "Tile matrix should have scale_denominator" assert hasattr(first_matrix, "tile_width"), "Tile matrix should have tile_width" - assert hasattr( - first_matrix, "tile_height" - ), "Tile matrix should have tile_height" + assert hasattr(first_matrix, "tile_height"), "Tile matrix should have tile_height" assert first_matrix.tile_width == 256, "Standard tile width should be 256" assert first_matrix.tile_height == 256, "Standard tile height should be 256" @@ -127,9 +115,7 @@ async def test_02_list_tile_matrices(self, planetarycomputer_endpoint): test_logger.info(f"Number of tile matrices: {len(response)}") # Assert response is a list - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Should have at least one tile matrix" # Check for expected tile matrix sets @@ -138,9 +124,7 @@ async def test_02_list_tile_matrices(self, planetarycomputer_endpoint): # All items should be strings for item in response: - assert isinstance( - item, str - ), f"Each item should be a string, got {type(item)}" + assert isinstance(item, str), f"Each item should be a string, got {type(item)}" test_logger.info("Test PASSED\n") @@ -173,28 +157,22 @@ async def test_03_list_available_assets( test_logger.info( f"Calling: list_available_assets(collection_id='{planetarycomputer_collection_id}', item_id='{planetarycomputer_item_id}')" ) - response = await client.data.list_available_assets( + response = await client.data.list_item_available_assets( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, ) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") - test_logger.info( - f"Number of assets: {len(response) if isinstance(response, list) else 'N/A'}" - ) + test_logger.info(f"Number of assets: {len(response) if isinstance(response, list) else 'N/A'}") # Assert response is a list - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Should have at least one asset" # All items should be strings for asset in response: - assert isinstance( - asset, str - ), f"Each asset should be a string, got {type(asset)}" + assert isinstance(asset, str), f"Each asset should be a string, got {type(asset)}" assert len(asset) > 0, "Asset name should not be empty" test_logger.info("Test PASSED\n") @@ -228,7 +206,7 @@ async def test_04_get_bounds( test_logger.info( f"Calling: list_bounds(collection_id='{planetarycomputer_collection_id}', item_id='{planetarycomputer_item_id}')" ) - response = await client.data.get_bounds( + response = await client.data.get_item_bounds( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, ) @@ -245,16 +223,12 @@ async def test_04_get_bounds( # Assert bounds is a list with 4 coordinates assert isinstance(bounds, list), f"Bounds should be a list, got {type(bounds)}" - assert ( - len(bounds) == 4 - ), f"Bounds should have 4 coordinates [minx, miny, maxx, maxy], got {len(bounds)}" + assert len(bounds) == 4, f"Bounds should have 4 coordinates [minx, miny, maxx, maxy], got {len(bounds)}" # Validate coordinate structure: [minx, miny, maxx, maxy] minx, miny, maxx, maxy = bounds for coord in bounds: - assert isinstance( - coord, (int, float) - ), f"Each coordinate should be numeric, got {type(coord)}" + assert isinstance(coord, (int, float)), f"Each coordinate should be numeric, got {type(coord)}" # Validate bounds logic assert minx < maxx, f"minx ({minx}) should be less than maxx ({maxx})" @@ -291,14 +265,14 @@ async def test_05_get_preview( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: get_preview(...)") - response = await client.data.get_preview( + response = await client.data.get_item_preview( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, format=TilerImageFormat.PNG, width=512, height=512, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) test_logger.info(f"Response type: {type(response)}") @@ -311,12 +285,8 @@ async def test_05_get_preview( # Verify PNG magic bytes png_magic = b"\x89PNG\r\n\x1a\n" assert len(image_bytes) > 0, "Image bytes should not be empty" - assert ( - len(image_bytes) > 100 - ), f"Image should be substantial, got only {len(image_bytes)} bytes" - assert ( - image_bytes[:8] == png_magic - ), "Response should be a valid PNG image (magic bytes mismatch)" + assert len(image_bytes) > 100, f"Image should be substantial, got only {len(image_bytes)} bytes" + assert image_bytes[:8] == png_magic, "Response should be a valid PNG image (magic bytes mismatch)" # Parse and validate the PNG image try: @@ -328,13 +298,9 @@ async def test_05_get_preview( test_logger.info(f"PIL Image mode: {image.mode}") # Validate image properties - assert ( - image.format == "PNG" - ), f"Image format should be PNG, got {image.format}" + assert image.format == "PNG", f"Image format should be PNG, got {image.format}" width, height = image.size - assert ( - width > 0 and height > 0 - ), f"Image should have non-zero dimensions, got {width}x{height}" + assert width > 0 and height > 0, f"Image should have non-zero dimensions, got {width}x{height}" # Note: Actual dimensions may differ slightly from requested due to aspect ratio preservation except ImportError: @@ -369,7 +335,7 @@ async def test_06_get_info_geo_json( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: get_info_geo_json(...)") - response = await client.data.get_info_geo_json( + response = await client.data.get_item_info_geo_json( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, assets=["image"], @@ -415,7 +381,7 @@ async def test_07_list_statistics( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: list_statistics(...)") - response = await client.data.list_statistics( + response = await client.data.list_item_statistics( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, assets=["image"], @@ -459,7 +425,7 @@ async def test_08_get_wmts_capabilities( client = self.create_client(endpoint=planetarycomputer_endpoint) test_logger.info("Calling: get_wmts_capabilities(...)") - response = await client.data.get_wmts_capabilities( + response = await client.data.get_item_wmts_capabilities( collection_id=planetarycomputer_collection_id, item_id=planetarycomputer_item_id, tile_matrix_set_id="WebMercatorQuad", @@ -468,7 +434,7 @@ async def test_08_get_wmts_capabilities( min_zoom=7, max_zoom=14, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) test_logger.info(f"Response type: {type(response)}") @@ -484,15 +450,9 @@ async def test_08_get_wmts_capabilities( # Validate XML structure assert len(xml_bytes) > 0, "XML bytes should not be empty" # Note: WMTS Capabilities XML may not have 0, "Search ID should not be empty" test_logger.info(f"Search ID: {search_id}") @@ -113,9 +104,7 @@ def test_01_register_mosaics_search( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_02_get_mosaics_search_info( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_02_get_mosaics_search_info(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting mosaics search info. @@ -154,18 +143,14 @@ def test_02_get_mosaics_search_info( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) register_response = client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Registered search ID: {search_id}") test_logger.info(f"Calling: get_mosaics_search_info(search_id='{search_id}')") - response = client.data.get_mosaics_search_info(search_id=search_id) + response = client.data.get_searches_info(search_id=search_id) test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): @@ -182,9 +167,7 @@ def test_02_get_mosaics_search_info( assert hasattr(search, "hash"), "Search should have 'hash' attribute" search_hash = search.hash - assert isinstance( - search_hash, str - ), f"Search hash should be a string, got {type(search_hash)}" + assert isinstance(search_hash, str), f"Search hash should be a string, got {type(search_hash)}" assert len(search_hash) > 0, "Search hash should not be empty" test_logger.info(f"Search hash: {search_hash}") @@ -192,9 +175,7 @@ def test_02_get_mosaics_search_info( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_03_get_mosaics_tile_json( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_03_get_mosaics_tile_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting mosaics tile JSON. @@ -233,25 +214,21 @@ def test_03_get_mosaics_tile_json( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) register_response = client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_tile_json(...)") - response = client.data.get_mosaics_tile_json( + response = client.data.get_searches_tile_json( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], tile_scale=1, min_zoom=9, - collection=planetarycomputer_collection_id, + collection_id=planetarycomputer_collection_id, tile_format="png", ) @@ -276,11 +253,10 @@ def test_03_get_mosaics_tile_json( test_logger.info("Test PASSED\n") + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_04_get_mosaics_tile( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific mosaic tile. @@ -320,18 +296,14 @@ def test_04_get_mosaics_tile( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) register_response = client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_tile(...)") - response = client.data.get_mosaics_tile( + response = client.data.get_searches_tile_by_scale_and_format( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -340,7 +312,7 @@ def test_04_get_mosaics_tile( scale=1, format="png", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], collection=planetarycomputer_collection_id, ) @@ -354,12 +326,8 @@ def test_04_get_mosaics_tile( # Verify PNG magic bytes png_magic = b"\x89PNG\r\n\x1a\n" assert len(image_bytes) > 0, "Image bytes should not be empty" - assert ( - len(image_bytes) > 100 - ), f"Image should be substantial, got only {len(image_bytes)} bytes" - assert ( - image_bytes[:8] == png_magic - ), "Response should be a valid PNG image (magic bytes mismatch)" + assert len(image_bytes) > 100, f"Image should be substantial, got only {len(image_bytes)} bytes" + assert image_bytes[:8] == png_magic, "Response should be a valid PNG image (magic bytes mismatch)" # Parse and validate the PNG image try: @@ -371,24 +339,19 @@ def test_04_get_mosaics_tile( test_logger.info(f"PIL Image mode: {image.mode}") # Validate image properties - assert ( - image.format == "PNG" - ), f"Image format should be PNG, got {image.format}" + assert image.format == "PNG", f"Image format should be PNG, got {image.format}" width, height = image.size - assert ( - width > 0 and height > 0 - ), f"Image should have non-zero dimensions, got {width}x{height}" + assert width > 0 and height > 0, f"Image should have non-zero dimensions, got {width}x{height}" except ImportError: test_logger.warning("PIL not available, skipping detailed image validation") test_logger.info("Test PASSED\n") + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_05_get_mosaics_wmts_capabilities( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting WMTS capabilities XML for mosaics. @@ -427,18 +390,14 @@ def test_05_get_mosaics_wmts_capabilities( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) register_response = client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_wmts_capabilities(...)") - response = client.data.get_mosaics_wmts_capabilities( + response = client.data.get_searches_wmts_capabilities( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", tile_format=TilerImageFormat.PNG, @@ -446,7 +405,7 @@ def test_05_get_mosaics_wmts_capabilities( min_zoom=7, max_zoom=13, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) test_logger.info(f"Response type: {type(response)}") @@ -462,23 +421,16 @@ def test_05_get_mosaics_wmts_capabilities( # Validate XML structure assert len(xml_bytes) > 0, "XML bytes should not be empty" # Note: WMTS Capabilities XML may not have 0: @@ -562,31 +504,22 @@ def test_06_get_mosaics_assets_for_point( assert first_asset is not None, "First asset should not be None" # StacAsset behaves like a dict - access via key - asset_dict = ( - first_asset.as_dict() - if hasattr(first_asset, "as_dict") - else first_asset - ) - assert ( - "id" in asset_dict - ), f"Asset should have 'id' key, got keys: {list(asset_dict.keys())}" + asset_dict = first_asset.as_dict() if hasattr(first_asset, "as_dict") else first_asset + assert "id" in asset_dict, f"Asset should have 'id' key, got keys: {list(asset_dict.keys())}" asset_id = asset_dict["id"] test_logger.info(f"First asset ID: {asset_id}") - assert isinstance( - asset_id, str - ), f"Asset ID should be a string, got {type(asset_id)}" + assert isinstance(asset_id, str), f"Asset ID should be a string, got {type(asset_id)}" assert len(asset_id) > 0, "Asset ID should not be empty" else: test_logger.info("No assets returned for this point") test_logger.info("Test PASSED\n") + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_07_get_mosaics_assets_for_tile( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_07_get_mosaics_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting mosaic assets for a specific tile. @@ -626,18 +559,14 @@ def test_07_get_mosaics_assets_for_tile( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) register_response = client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_assets_for_tile(...)") - response = client.data.get_mosaics_assets_for_tile( + response = client.data.get_searches_assets_for_tile( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -658,192 +587,171 @@ def test_07_get_mosaics_assets_for_tile( test_logger.info("Test PASSED\n") + @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_08_create_static_image( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): - """ - Test creating a static image from a mosaic search. - - Expected response: - - Object with image ID that can be used to retrieve the image - """ + def test_08_get_searches_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting point data from a mosaic search.""" test_logger.info("=" * 80) - test_logger.info("TEST: test_08_create_static_image") + test_logger.info("TEST: test_08_get_searches_point") test_logger.info("=" * 80) - test_logger.info(f"Input - endpoint: {planetarycomputer_endpoint}") - test_logger.info(f"Input - collection_id: {planetarycomputer_collection_id}") - - from azure.planetarycomputer.models import ( - ImageParameters, - Polygon, - ) client = self.create_client(endpoint=planetarycomputer_endpoint) - # Define geometry for the static image - geometry = Polygon( - coordinates=[ - [ - [-84.45378097481053, 33.6567321707079], - [-84.39805886744838, 33.6567321707079], - [-84.39805886744838, 33.61945681366625], - [-84.45378097481053, 33.61945681366625], - [-84.45378097481053, 33.6567321707079], - ] - ] - ) - - test_logger.info(f"Geometry: {geometry}") - - # Create CQL2-JSON filter - cql_filter = { - "op": "and", - "args": [ - { - "op": "=", - "args": [ - {"property": "collection"}, - planetarycomputer_collection_id, - ], - }, - { - "op": "anyinteracts", - "args": [ - {"property": "datetime"}, - {"interval": ["2023-01-01T00:00:00Z", "2023-12-31T00:00:00Z"]}, - ], - }, - ], + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, } + register_response = client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id - # Create image request - image_request = ImageParameters( - cql=cql_filter, - zoom=13, - geometry=geometry, - render_parameters=f"assets=image&asset_bidx=image|1,2,3&collection={planetarycomputer_collection_id}", - columns=1080, - rows=1080, - image_size="1080x1080", - show_branding=False, + # Note: assets or expression is required for point queries (returns 400 without one) + response = client.data.get_searches_point( + search_id=search_id, + longitude=-84.3860, + latitude=33.6760, + assets=["image"], ) - test_logger.info( - f"Image request: columns={image_request.columns}, rows={image_request.rows}, zoom={image_request.zoom}" - ) + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting a bbox crop from a mosaic search.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_09_get_searches_bbox_crop") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info("Calling: create_static_image(...)") - response = client.data.create_static_image( - collection_id=planetarycomputer_collection_id, body=image_request + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, + } + register_response = client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id + + response = client.data.get_searches_bbox_crop( + search_id=search_id, + minx=-84.3930, + miny=33.6798, + maxx=-84.3670, + maxy=33.7058, + format="png", + assets=["image"], + asset_band_indices=["image|1,2,3"], ) - test_logger.info(f"Response type: {type(response)}") - test_logger.info(f"Response: {response}") + image_bytes = b"".join(response) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + assert len(image_bytes) > 0 - # Log response details based on type - if hasattr(response, "as_dict"): - response_dict = response.as_dict() - test_logger.info(f"Response dict keys: {list(response_dict.keys())}") - test_logger.info(f"Response dict: {response_dict}") + test_logger.info("Test PASSED\n") + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_09_get_static_image( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): - """ - Test retrieving a static image by ID. - - Expected response: - - Binary image data (streaming generator) - - Valid PNG format with magic bytes - """ + def test_10_crop_searches_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test cropping a mosaic search by GeoJSON feature.""" test_logger.info("=" * 80) - test_logger.info("TEST: test_09_get_static_image") + test_logger.info("TEST: test_10_crop_searches_feature_geo_json") test_logger.info("=" * 80) - test_logger.info(f"Input - endpoint: {planetarycomputer_endpoint}") - test_logger.info(f"Input - collection_id: {planetarycomputer_collection_id}") - from azure.planetarycomputer.models import ( - ImageParameters, - Polygon, - ) + from azure.planetarycomputer.models import Feature, FeatureType, Polygon client = self.create_client(endpoint=planetarycomputer_endpoint) - # First create a static image to get an ID - geometry = Polygon( - coordinates=[ - [ - [-84.45378097481053, 33.6567321707079], - [-84.39805886744838, 33.6567321707079], - [-84.39805886744838, 33.61945681366625], - [-84.45378097481053, 33.61945681366625], - [-84.45378097481053, 33.6567321707079], - ] - ] - ) - - cql_filter = { - "op": "and", - "args": [ - { - "op": "=", - "args": [ - {"property": "collection"}, - planetarycomputer_collection_id, - ], - }, - { - "op": "anyinteracts", - "args": [ - {"property": "datetime"}, - {"interval": ["2023-01-01T00:00:00Z", "2023-12-31T00:00:00Z"]}, - ], - }, - ], + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, } + register_response = client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id - image_request = ImageParameters( - cql=cql_filter, - zoom=13, - geometry=geometry, - render_parameters=f"assets=image&asset_bidx=image|1,2,3&collection={planetarycomputer_collection_id}", - columns=1080, - rows=1080, - image_size="1080x1080", - show_branding=False, + geojson_feature = Feature( + type=FeatureType.FEATURE, + geometry=Polygon( + coordinates=[ + [ + [-84.3930, 33.6798], + [-84.3670, 33.6798], + [-84.3670, 33.7058], + [-84.3930, 33.7058], + [-84.3930, 33.6798], + ] + ] + ), + properties={}, ) - create_response = client.data.create_static_image( - collection_id=planetarycomputer_collection_id, body=image_request + response = client.data.crop_searches_feature_geo_json( + search_id=search_id, + body=geojson_feature, + assets=["image"], + asset_band_indices=["image|1,2,3"], ) - url = create_response.url + image_bytes = b"".join(response) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + assert len(image_bytes) > 0 - # Extract image ID from URL - split by '?' to remove query params, then get last path segment - image_id = url.split("?")[0].split("/")[-1] + test_logger.info("Test PASSED\n") - test_logger.info(f"Created image with ID: {image_id}") - test_logger.info(f"Image URL: {url}") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_11_list_searches_tilesets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test listing tilesets for a mosaic search.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_11_list_searches_tilesets") + test_logger.info("=" * 80) - # Assert that we got a valid image ID - assert ( - image_id is not None and len(image_id) > 0 - ), f"Failed to get image ID from create_static_image response: {create_response}" + client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_static_image(collection_id='{planetarycomputer_collection_id}', id='{image_id}')" - ) - image_data = client.data.get_static_image( - collection_id=planetarycomputer_collection_id, id=image_id + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, + } + register_response = client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id + + response = client.data.list_searches_tilesets( + search_id=search_id, ) - test_logger.info(f"Image data type: {type(image_data)}") + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" - # Collect the streaming response into bytes - image_bytes = b"".join(image_data) - test_logger.info(f"Image size: {len(image_bytes)} bytes") - test_logger.info(f"First 16 bytes (hex): {image_bytes[:16].hex()}") + test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py index d508d397071f..4b6ec4fbb625 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py @@ -9,6 +9,7 @@ import io import logging from pathlib import Path +import pytest from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import recorded_by_proxy from testpreparer_async import PlanetaryComputerProClientTestBaseAsync @@ -43,9 +44,7 @@ class TestPlanetaryComputerMosaicsTilerAsync(PlanetaryComputerProClientTestBaseA @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_01_register_mosaics_search( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_01_register_mosaics_search(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test registering a mosaics search. @@ -84,11 +83,7 @@ async def test_01_register_mosaics_search( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) test_logger.info(f"Search request: {register_search_request}") @@ -100,14 +95,10 @@ async def test_01_register_mosaics_search( # Validate response structure assert response is not None, "Response should not be None" - assert hasattr( - response, "search_id" - ), "Response should have 'search_id' attribute" + assert hasattr(response, "search_id"), "Response should have 'search_id' attribute" search_id = response.search_id - assert isinstance( - search_id, str - ), f"Search ID should be a string, got {type(search_id)}" + assert isinstance(search_id, str), f"Search ID should be a string, got {type(search_id)}" assert len(search_id) > 0, "Search ID should not be empty" test_logger.info(f"Search ID: {search_id}") @@ -117,9 +108,7 @@ async def test_01_register_mosaics_search( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_02_get_mosaics_search_info( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_02_get_mosaics_search_info(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting mosaics search info. @@ -158,20 +147,14 @@ async def test_02_get_mosaics_search_info( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_response = await client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_response = await client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Registered search ID: {search_id}") test_logger.info(f"Calling: get_mosaics_search_info(search_id='{search_id}')") - response = await client.data.get_mosaics_search_info(search_id=search_id) + response = await client.data.get_searches_info(search_id=search_id) test_logger.info(f"Response type: {type(response)}") if hasattr(response, "as_dict"): @@ -188,9 +171,7 @@ async def test_02_get_mosaics_search_info( assert hasattr(search, "hash"), "Search should have 'hash' attribute" search_hash = search.hash - assert isinstance( - search_hash, str - ), f"Search hash should be a string, got {type(search_hash)}" + assert isinstance(search_hash, str), f"Search hash should be a string, got {type(search_hash)}" assert len(search_hash) > 0, "Search hash should not be empty" test_logger.info(f"Search hash: {search_hash}") @@ -200,9 +181,7 @@ async def test_02_get_mosaics_search_info( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_03_get_mosaics_tile_json( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_03_get_mosaics_tile_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting mosaics tile JSON. @@ -241,27 +220,21 @@ async def test_03_get_mosaics_tile_json( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_response = await client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_response = await client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_tile_json(...)") - response = await client.data.get_mosaics_tile_json( + response = await client.data.get_searches_tile_json( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], tile_scale=1, min_zoom=9, - collection=planetarycomputer_collection_id, + collection_id=planetarycomputer_collection_id, tile_format="png", ) @@ -288,11 +261,10 @@ async def test_03_get_mosaics_tile_json( await self.close_client() + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_04_get_mosaics_tile( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting a specific mosaic tile. @@ -332,20 +304,14 @@ async def test_04_get_mosaics_tile( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_response = await client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_response = await client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_tile(...)") - response = await client.data.get_mosaics_tile( + response = await client.data.get_searches_tile_by_scale_and_format( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -354,7 +320,7 @@ async def test_04_get_mosaics_tile( scale=1, format="png", assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], collection=planetarycomputer_collection_id, ) @@ -368,12 +334,8 @@ async def test_04_get_mosaics_tile( # Verify PNG magic bytes png_magic = b"\x89PNG\r\n\x1a\n" assert len(image_bytes) > 0, "Image bytes should not be empty" - assert ( - len(image_bytes) > 100 - ), f"Image should be substantial, got only {len(image_bytes)} bytes" - assert ( - image_bytes[:8] == png_magic - ), "Response should be a valid PNG image (magic bytes mismatch)" + assert len(image_bytes) > 100, f"Image should be substantial, got only {len(image_bytes)} bytes" + assert image_bytes[:8] == png_magic, "Response should be a valid PNG image (magic bytes mismatch)" # Parse and validate the PNG image try: @@ -385,13 +347,9 @@ async def test_04_get_mosaics_tile( test_logger.info(f"PIL Image mode: {image.mode}") # Validate image properties - assert ( - image.format == "PNG" - ), f"Image format should be PNG, got {image.format}" + assert image.format == "PNG", f"Image format should be PNG, got {image.format}" width, height = image.size - assert ( - width > 0 and height > 0 - ), f"Image should have non-zero dimensions, got {width}x{height}" + assert width > 0 and height > 0, f"Image should have non-zero dimensions, got {width}x{height}" except ImportError: test_logger.warning("PIL not available, skipping detailed image validation") @@ -400,11 +358,10 @@ async def test_04_get_mosaics_tile( await self.close_client() + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_05_get_mosaics_wmts_capabilities( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting WMTS capabilities XML for mosaics. @@ -443,20 +400,14 @@ async def test_05_get_mosaics_wmts_capabilities( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_response = await client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_response = await client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_wmts_capabilities(...)") - response = await client.data.get_mosaics_wmts_capabilities( + response = await client.data.get_searches_wmts_capabilities( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", tile_format=TilerImageFormat.PNG, @@ -464,7 +415,7 @@ async def test_05_get_mosaics_wmts_capabilities( min_zoom=7, max_zoom=13, assets=["image"], - asset_band_indices="image|1,2,3", + asset_band_indices=["image|1,2,3"], ) test_logger.info(f"Response type: {type(response)}") @@ -480,25 +431,18 @@ async def test_05_get_mosaics_wmts_capabilities( # Validate XML structure assert len(xml_bytes) > 0, "XML bytes should not be empty" # Note: WMTS Capabilities XML may not have 0: @@ -584,20 +516,12 @@ async def test_06_get_mosaics_assets_for_point( assert first_asset is not None, "First asset should not be None" # StacAsset behaves like a dict - access via key - asset_dict = ( - first_asset.as_dict() - if hasattr(first_asset, "as_dict") - else first_asset - ) - assert ( - "id" in asset_dict - ), f"Asset should have 'id' key, got keys: {list(asset_dict.keys())}" + asset_dict = first_asset.as_dict() if hasattr(first_asset, "as_dict") else first_asset + assert "id" in asset_dict, f"Asset should have 'id' key, got keys: {list(asset_dict.keys())}" asset_id = asset_dict["id"] test_logger.info(f"First asset ID: {asset_id}") - assert isinstance( - asset_id, str - ), f"Asset ID should be a string, got {type(asset_id)}" + assert isinstance(asset_id, str), f"Asset ID should be a string, got {type(asset_id)}" assert len(asset_id) > 0, "Asset ID should not be empty" else: test_logger.info("No assets returned for this point") @@ -606,11 +530,10 @@ async def test_06_get_mosaics_assets_for_point( await self.close_client() + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_07_get_mosaics_assets_for_tile( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_07_get_mosaics_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test getting mosaic assets for a specific tile. @@ -650,20 +573,14 @@ async def test_07_get_mosaics_assets_for_tile( ], }, filter_lang=FilterLanguage.CQL2_JSON, - sort_by=[ - StacSortExtension( - direction=StacSearchSortingDirection.DESC, field="datetime" - ) - ], - ) - register_response = await client.data.register_mosaics_search( - register_search_request + sort_by=[StacSortExtension(direction=StacSearchSortingDirection.DESC, field="datetime")], ) + register_response = await client.data.register_mosaics_search(register_search_request) search_id = register_response.search_id test_logger.info(f"Using search ID: {search_id}") test_logger.info("Calling: get_mosaics_assets_for_tile(...)") - response = await client.data.get_mosaics_assets_for_tile( + response = await client.data.get_searches_assets_for_tile( search_id=search_id, tile_matrix_set_id="WebMercatorQuad", z=13, @@ -686,196 +603,175 @@ async def test_07_get_mosaics_assets_for_tile( await self.close_client() + @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_08_create_static_image( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): - """ - Test creating a static image from a mosaic search. - - Expected response: - - Object with image ID that can be used to retrieve the image - """ + async def test_08_get_searches_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting point data from a mosaic search.""" test_logger.info("=" * 80) - test_logger.info("TEST: test_08_create_static_image") + test_logger.info("TEST: test_08_get_searches_point") test_logger.info("=" * 80) - test_logger.info(f"Input - endpoint: {planetarycomputer_endpoint}") - test_logger.info(f"Input - collection_id: {planetarycomputer_collection_id}") - - from azure.planetarycomputer.models import ( - ImageParameters, - Polygon, - ) client = self.create_client(endpoint=planetarycomputer_endpoint) - # Define geometry for the static image - geometry = Polygon( - coordinates=[ - [ - [-84.45378097481053, 33.6567321707079], - [-84.39805886744838, 33.6567321707079], - [-84.39805886744838, 33.61945681366625], - [-84.45378097481053, 33.61945681366625], - [-84.45378097481053, 33.6567321707079], - ] - ] - ) - - test_logger.info(f"Geometry: {geometry}") - - # Create CQL2-JSON filter - cql_filter = { - "op": "and", - "args": [ - { - "op": "=", - "args": [ - {"property": "collection"}, - planetarycomputer_collection_id, - ], - }, - { - "op": "anyinteracts", - "args": [ - {"property": "datetime"}, - {"interval": ["2023-01-01T00:00:00Z", "2023-12-31T00:00:00Z"]}, - ], - }, - ], + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, } + register_response = await client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id - # Create image request - image_request = ImageParameters( - cql=cql_filter, - zoom=13, - geometry=geometry, - render_parameters=f"assets=image&asset_bidx=image|1,2,3&collection={planetarycomputer_collection_id}", - columns=1080, - rows=1080, - image_size="1080x1080", - show_branding=False, + # Note: assets or expression is required for point queries (returns 400 without one) + response = await client.data.get_searches_point( + search_id=search_id, + longitude=-84.3860, + latitude=33.6760, + assets=["image"], ) - test_logger.info( - f"Image request: columns={image_request.columns}, rows={image_request.rows}, zoom={image_request.zoom}" - ) + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" - test_logger.info("Calling: create_static_image(...)") - response = await client.data.create_static_image( - collection_id=planetarycomputer_collection_id, body=image_request - ) + test_logger.info("Test PASSED\n") + await self.close_client() - test_logger.info(f"Response type: {type(response)}") - test_logger.info(f"Response: {response}") + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting a bbox crop from a mosaic search.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_09_get_searches_bbox_crop") + test_logger.info("=" * 80) - # Log response details based on type - if hasattr(response, "as_dict"): - response_dict = response.as_dict() - test_logger.info(f"Response dict keys: {list(response_dict.keys())}") - test_logger.info(f"Response dict: {response_dict}") + client = self.create_client(endpoint=planetarycomputer_endpoint) + + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, + } + register_response = await client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id + response = await client.data.get_searches_bbox_crop( + search_id=search_id, + minx=-84.3930, + miny=33.6798, + maxx=-84.3670, + maxy=33.7058, + format="png", + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join([chunk async for chunk in response]) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + assert len(image_bytes) > 0 + + test_logger.info("Test PASSED\n") await self.close_client() + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_09_get_static_image( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): - """ - Test retrieving a static image by ID. - - Expected response: - - Binary image data (streaming generator) - - Valid PNG format with magic bytes - """ + async def test_10_crop_searches_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test cropping a mosaic search by GeoJSON feature.""" test_logger.info("=" * 80) - test_logger.info("TEST: test_09_get_static_image") + test_logger.info("TEST: test_10_crop_searches_feature_geo_json") test_logger.info("=" * 80) - test_logger.info(f"Input - endpoint: {planetarycomputer_endpoint}") - test_logger.info(f"Input - collection_id: {planetarycomputer_collection_id}") - from azure.planetarycomputer.models import ( - ImageParameters, - Polygon, - ) + from azure.planetarycomputer.models import Feature, FeatureType, Polygon client = self.create_client(endpoint=planetarycomputer_endpoint) - # First create a static image to get an ID - geometry = Polygon( - coordinates=[ - [ - [-84.45378097481053, 33.6567321707079], - [-84.39805886744838, 33.6567321707079], - [-84.39805886744838, 33.61945681366625], - [-84.45378097481053, 33.61945681366625], - [-84.45378097481053, 33.6567321707079], - ] - ] - ) - - cql_filter = { - "op": "and", - "args": [ - { - "op": "=", - "args": [ - {"property": "collection"}, - planetarycomputer_collection_id, - ], - }, - { - "op": "anyinteracts", - "args": [ - {"property": "datetime"}, - {"interval": ["2023-01-01T00:00:00Z", "2023-12-31T00:00:00Z"]}, - ], - }, - ], + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, } + register_response = await client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id - image_request = ImageParameters( - cql=cql_filter, - zoom=13, - geometry=geometry, - render_parameters=f"assets=image&asset_bidx=image|1,2,3&collection={planetarycomputer_collection_id}", - columns=1080, - rows=1080, - image_size="1080x1080", - show_branding=False, + geojson_feature = Feature( + type=FeatureType.FEATURE, + geometry=Polygon( + coordinates=[ + [ + [-84.3930, 33.6798], + [-84.3670, 33.6798], + [-84.3670, 33.7058], + [-84.3930, 33.7058], + [-84.3930, 33.6798], + ] + ] + ), + properties={}, ) - create_response = await client.data.create_static_image( - collection_id=planetarycomputer_collection_id, body=image_request + response = await client.data.crop_searches_feature_geo_json( + search_id=search_id, + body=geojson_feature, + assets=["image"], + asset_band_indices=["image|1,2,3"], ) - url = create_response.url + image_bytes = b"".join([chunk async for chunk in response]) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + assert len(image_bytes) > 0 - # Extract image ID from URL - split by '?' to remove query params, then get last path segment - image_id = url.split("?")[0].split("/")[-1] + test_logger.info("Test PASSED\n") + await self.close_client() - test_logger.info(f"Created image with ID: {image_id}") - test_logger.info(f"Image URL: {url}") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_11_list_searches_tilesets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test listing tilesets for a mosaic search.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_11_list_searches_tilesets") + test_logger.info("=" * 80) - # Assert that we got a valid image ID - assert ( - image_id is not None and len(image_id) > 0 - ), f"Failed to get image ID from create_static_image response: {create_response}" + client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_static_image(collection_id='{planetarycomputer_collection_id}', id='{image_id}')" - ) - image_data = await client.data.get_static_image( - collection_id=planetarycomputer_collection_id, id=image_id - ) + register_search_request = { + "collections": [planetarycomputer_collection_id], + "filter-lang": "cql2-json", + "filter": { + "op": "anyinteracts", + "args": [ + {"property": "datetime"}, + {"interval": ["2021-01-01T00:00:00Z", "2022-12-31T00:00:00Z"]}, + ], + }, + } + register_response = await client.data.register_mosaics_search(register_search_request) + search_id = register_response.search_id - test_logger.info(f"Image data type: {type(image_data)}") + response = await client.data.list_searches_tilesets( + search_id=search_id, + ) - # Collect the streaming response into bytes - image_bytes = b"".join([chunk async for chunk in image_data]) - test_logger.info(f"Image size: {len(image_bytes)} bytes") - test_logger.info(f"First 16 bytes (hex): {image_bytes[:16].hex()}") + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + test_logger.info("Test PASSED\n") await self.close_client() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends.py index f658b36aafac..23db948d993b 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends.py @@ -53,9 +53,7 @@ def test_01_get_class_map_legend(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})" - ) + test_logger.info(f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})") response = client.data.get_class_map_legend( classmap_name=ColorMapNames.MTBS_SEVERITY, ) @@ -70,26 +68,18 @@ def test_01_get_class_map_legend(self, planetarycomputer_endpoint): # Assert MTBS Severity classes are present (0-6) expected_classes = ["0", "1", "2", "3", "4", "5", "6"] for class_value in expected_classes: - assert ( - class_value in response - ), f"Class '{class_value}' should be in response" + assert class_value in response, f"Class '{class_value}' should be in response" # Validate color structure for each class for class_value, color in response.items(): # Each color should be a list/array of 4 RGBA values - assert isinstance( - color, (list, tuple) - ), f"Color for class '{class_value}' should be a list/tuple" - assert ( - len(color) == 4 - ), f"Color for class '{class_value}' should have 4 RGBA values, got {len(color)}" + assert isinstance(color, (list, tuple)), f"Color for class '{class_value}' should be a list/tuple" + assert len(color) == 4, f"Color for class '{class_value}' should have 4 RGBA values, got {len(color)}" # Each RGBA component should be an integer 0-255 for i, component in enumerate(color): component_name = ["R", "G", "B", "A"][i] - assert isinstance( - component, int - ), f"{component_name} for class '{class_value}' should be int" + assert isinstance(component, int), f"{component_name} for class '{class_value}' should be int" assert ( 0 <= component <= 255 ), f"{component_name} for class '{class_value}' should be 0-255, got {component}" @@ -99,9 +89,7 @@ def test_01_get_class_map_legend(self, planetarycomputer_endpoint): assert response["0"] == [0, 0, 0, 0], "Class 0 should be transparent black" # Class 4: Red (high severity) - assert ( - response["4"][0] == 255 - ), "Class 4 (high severity) should have high red component" + assert response["4"][0] == 255, "Class 4 (high severity) should have high red component" test_logger.info("Test PASSED\n") @@ -124,46 +112,30 @@ def test_02_get_interval_legend(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_interval_legend(classmap_name={ColorMapNames.MODIS64_A1})" - ) - response = client.data.get_interval_legend( - classmap_name=ColorMapNames.MODIS64_A1 - ) + test_logger.info(f"Calling: get_interval_legend(classmap_name={ColorMapNames.MODIS64_A1})") + response = client.data.get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") # Assert response is a list - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Response should not be empty" # Validate each interval structure for idx, interval in enumerate(response): # Each interval should be a list with 2 elements: [range, color] assert isinstance(interval, list), f"Interval {idx} should be a list" - assert ( - len(interval) == 2 - ), f"Interval {idx} should have 2 elements: [[min, max], [R, G, B, A]]" + assert len(interval) == 2, f"Interval {idx} should have 2 elements: [[min, max], [R, G, B, A]]" # Validate range component value_range = interval[0] - assert isinstance( - value_range, list - ), f"Interval {idx} range should be a list" + assert isinstance(value_range, list), f"Interval {idx} range should be a list" assert len(value_range) == 2, f"Interval {idx} range should have [min, max]" min_val, max_val = value_range - assert isinstance( - min_val, (int, float) - ), f"Interval {idx} min should be numeric" - assert isinstance( - max_val, (int, float) - ), f"Interval {idx} max should be numeric" - assert ( - min_val <= max_val - ), f"Interval {idx} min ({min_val}) should be <= max ({max_val})" + assert isinstance(min_val, (int, float)), f"Interval {idx} min should be numeric" + assert isinstance(max_val, (int, float)), f"Interval {idx} max should be numeric" + assert min_val <= max_val, f"Interval {idx} min ({min_val}) should be <= max ({max_val})" # Validate color component color = interval[1] @@ -171,12 +143,8 @@ def test_02_get_interval_legend(self, planetarycomputer_endpoint): assert len(color) == 4, f"Interval {idx} color should have 4 RGBA values" for i, component in enumerate(color): component_name = ["R", "G", "B", "A"][i] - assert isinstance( - component, int - ), f"Interval {idx} {component_name} should be int" - assert ( - 0 <= component <= 255 - ), f"Interval {idx} {component_name} should be 0-255" + assert isinstance(component, int), f"Interval {idx} {component_name} should be int" + assert 0 <= component <= 255, f"Interval {idx} {component_name} should be 0-255" # Validate intervals are sequential (each max should connect to next min) for i in range(len(response) - 1): @@ -223,18 +191,12 @@ def test_03_get_legend_as_png(self, planetarycomputer_endpoint): # Verify PNG magic bytes (89 50 4E 47 0D 0A 1A 0A) png_magic = b"\x89PNG\r\n\x1a\n" test_logger.info(f"PNG magic bytes: {png_magic.hex()}") - test_logger.info( - f"Response starts with PNG magic: {legend_bytes[:8] == png_magic}" - ) + test_logger.info(f"Response starts with PNG magic: {legend_bytes[:8] == png_magic}") # Assert response is valid PNG assert len(legend_bytes) > 0, "Legend bytes should not be empty" - assert ( - len(legend_bytes) > 100 - ), f"Legend should be substantial image, got only {len(legend_bytes)} bytes" - assert ( - legend_bytes[:8] == png_magic - ), "Response should be a valid PNG image (magic bytes mismatch)" + assert len(legend_bytes) > 100, f"Legend should be substantial image, got only {len(legend_bytes)} bytes" + assert legend_bytes[:8] == png_magic, "Response should be a valid PNG image (magic bytes mismatch)" # Parse and validate the PNG image try: @@ -250,19 +212,13 @@ def test_03_get_legend_as_png(self, planetarycomputer_endpoint): # Image dimensions should be non-zero width, height = legend_image.size - assert ( - width > 0 and height > 0 - ), f"Image should have non-zero dimensions, got {width}x{height}" + assert width > 0 and height > 0, f"Image should have non-zero dimensions, got {width}x{height}" # Typical legend is horizontal (width >> height) - assert ( - width > height - ), f"Legend should be horizontal (width > height), got {width}x{height}" + assert width > height, f"Legend should be horizontal (width > height), got {width}x{height}" # Color mode should be RGBA (with alpha channel) - assert ( - legend_image.mode == "RGBA" - ), f"Image mode should be RGBA, got {legend_image.mode}" + assert legend_image.mode == "RGBA", f"Image mode should be RGBA, got {legend_image.mode}" except ImportError: test_logger.warning("PIL not available, skipping image parsing") @@ -297,9 +253,7 @@ def test_04_get_legend_with_different_colormap(self, planetarycomputer_endpoint) # Verify PNG magic bytes png_magic = b"\x89PNG\r\n\x1a\n" assert len(legend_bytes) > 0, "Legend bytes should not be empty" - assert ( - len(legend_bytes) > 100 - ), f"Legend should be substantial image, got only {len(legend_bytes)} bytes" + assert len(legend_bytes) > 100, f"Legend should be substantial image, got only {len(legend_bytes)} bytes" assert legend_bytes[:8] == png_magic, "Response should be a valid PNG image" # Parse and validate the PNG image @@ -338,9 +292,7 @@ def test_05_class_map_legend_structure(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})" - ) + test_logger.info(f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})") response = client.data.get_class_map_legend( classmap_name=ColorMapNames.MTBS_SEVERITY, ) @@ -364,16 +316,10 @@ def test_05_class_map_legend_structure(self, planetarycomputer_endpoint): ), "All color components should be integers 0-255" # Validate that different classes have different colors (except transparent) - non_transparent_colors = [ - tuple(c) for c in all_colors if c[3] != 0 - ] # Exclude transparent + non_transparent_colors = [tuple(c) for c in all_colors if c[3] != 0] # Exclude transparent # Convert to set to check uniqueness unique_colors = set(non_transparent_colors) - assert ( - len(unique_colors) > 1 - ), "Non-transparent classes should have different colors" + assert len(unique_colors) > 1, "Non-transparent classes should have different colors" - test_logger.info( - f"Found {len(response)} classes with {len(unique_colors)} unique non-transparent colors" - ) + test_logger.info(f"Found {len(response)} classes with {len(unique_colors)} unique non-transparent colors") test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends_async.py index 4a6738ba7256..95b07d39cd75 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_06_map_legends_async.py @@ -55,9 +55,7 @@ async def test_01_get_class_map_legend(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})" - ) + test_logger.info(f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})") response = await client.data.get_class_map_legend( classmap_name=ColorMapNames.MTBS_SEVERITY, ) @@ -72,26 +70,18 @@ async def test_01_get_class_map_legend(self, planetarycomputer_endpoint): # Assert MTBS Severity classes are present (0-6) expected_classes = ["0", "1", "2", "3", "4", "5", "6"] for class_value in expected_classes: - assert ( - class_value in response - ), f"Class '{class_value}' should be in response" + assert class_value in response, f"Class '{class_value}' should be in response" # Validate color structure for each class for class_value, color in response.items(): # Each color should be a list/array of 4 RGBA values - assert isinstance( - color, (list, tuple) - ), f"Color for class '{class_value}' should be a list/tuple" - assert ( - len(color) == 4 - ), f"Color for class '{class_value}' should have 4 RGBA values, got {len(color)}" + assert isinstance(color, (list, tuple)), f"Color for class '{class_value}' should be a list/tuple" + assert len(color) == 4, f"Color for class '{class_value}' should have 4 RGBA values, got {len(color)}" # Each RGBA component should be an integer 0-255 for i, component in enumerate(color): component_name = ["R", "G", "B", "A"][i] - assert isinstance( - component, int - ), f"{component_name} for class '{class_value}' should be int" + assert isinstance(component, int), f"{component_name} for class '{class_value}' should be int" assert ( 0 <= component <= 255 ), f"{component_name} for class '{class_value}' should be 0-255, got {component}" @@ -101,9 +91,7 @@ async def test_01_get_class_map_legend(self, planetarycomputer_endpoint): assert response["0"] == [0, 0, 0, 0], "Class 0 should be transparent black" # Class 4: Red (high severity) - assert ( - response["4"][0] == 255 - ), "Class 4 (high severity) should have high red component" + assert response["4"][0] == 255, "Class 4 (high severity) should have high red component" test_logger.info("Test PASSED\n") @@ -128,46 +116,30 @@ async def test_02_get_interval_legend(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_interval_legend(classmap_name={ColorMapNames.MODIS64_A1})" - ) - response = await client.data.get_interval_legend( - classmap_name=ColorMapNames.MODIS64_A1 - ) + test_logger.info(f"Calling: get_interval_legend(classmap_name={ColorMapNames.MODIS64_A1})") + response = await client.data.get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) test_logger.info(f"Response type: {type(response)}") test_logger.info(f"Response: {response}") # Assert response is a list - assert isinstance( - response, list - ), f"Response should be a list, got {type(response)}" + assert isinstance(response, list), f"Response should be a list, got {type(response)}" assert len(response) > 0, "Response should not be empty" # Validate each interval structure for idx, interval in enumerate(response): # Each interval should be a list with 2 elements: [range, color] assert isinstance(interval, list), f"Interval {idx} should be a list" - assert ( - len(interval) == 2 - ), f"Interval {idx} should have 2 elements: [[min, max], [R, G, B, A]]" + assert len(interval) == 2, f"Interval {idx} should have 2 elements: [[min, max], [R, G, B, A]]" # Validate range component value_range = interval[0] - assert isinstance( - value_range, list - ), f"Interval {idx} range should be a list" + assert isinstance(value_range, list), f"Interval {idx} range should be a list" assert len(value_range) == 2, f"Interval {idx} range should have [min, max]" min_val, max_val = value_range - assert isinstance( - min_val, (int, float) - ), f"Interval {idx} min should be numeric" - assert isinstance( - max_val, (int, float) - ), f"Interval {idx} max should be numeric" - assert ( - min_val <= max_val - ), f"Interval {idx} min ({min_val}) should be <= max ({max_val})" + assert isinstance(min_val, (int, float)), f"Interval {idx} min should be numeric" + assert isinstance(max_val, (int, float)), f"Interval {idx} max should be numeric" + assert min_val <= max_val, f"Interval {idx} min ({min_val}) should be <= max ({max_val})" # Validate color component color = interval[1] @@ -175,12 +147,8 @@ async def test_02_get_interval_legend(self, planetarycomputer_endpoint): assert len(color) == 4, f"Interval {idx} color should have 4 RGBA values" for i, component in enumerate(color): component_name = ["R", "G", "B", "A"][i] - assert isinstance( - component, int - ), f"Interval {idx} {component_name} should be int" - assert ( - 0 <= component <= 255 - ), f"Interval {idx} {component_name} should be 0-255" + assert isinstance(component, int), f"Interval {idx} {component_name} should be int" + assert 0 <= component <= 255, f"Interval {idx} {component_name} should be 0-255" # Validate intervals are sequential (each max should connect to next min) for i in range(len(response) - 1): @@ -229,18 +197,12 @@ async def test_03_get_legend_as_png(self, planetarycomputer_endpoint): # Verify PNG magic bytes (89 50 4E 47 0D 0A 1A 0A) png_magic = b"\x89PNG\r\n\x1a\n" test_logger.info(f"PNG magic bytes: {png_magic.hex()}") - test_logger.info( - f"Response starts with PNG magic: {legend_bytes[:8] == png_magic}" - ) + test_logger.info(f"Response starts with PNG magic: {legend_bytes[:8] == png_magic}") # Assert response is valid PNG assert len(legend_bytes) > 0, "Legend bytes should not be empty" - assert ( - len(legend_bytes) > 100 - ), f"Legend should be substantial image, got only {len(legend_bytes)} bytes" - assert ( - legend_bytes[:8] == png_magic - ), "Response should be a valid PNG image (magic bytes mismatch)" + assert len(legend_bytes) > 100, f"Legend should be substantial image, got only {len(legend_bytes)} bytes" + assert legend_bytes[:8] == png_magic, "Response should be a valid PNG image (magic bytes mismatch)" # Parse and validate the PNG image try: @@ -256,19 +218,13 @@ async def test_03_get_legend_as_png(self, planetarycomputer_endpoint): # Image dimensions should be non-zero width, height = legend_image.size - assert ( - width > 0 and height > 0 - ), f"Image should have non-zero dimensions, got {width}x{height}" + assert width > 0 and height > 0, f"Image should have non-zero dimensions, got {width}x{height}" # Typical legend is horizontal (width >> height) - assert ( - width > height - ), f"Legend should be horizontal (width > height), got {width}x{height}" + assert width > height, f"Legend should be horizontal (width > height), got {width}x{height}" # Color mode should be RGBA (with alpha channel) - assert ( - legend_image.mode == "RGBA" - ), f"Image mode should be RGBA, got {legend_image.mode}" + assert legend_image.mode == "RGBA", f"Image mode should be RGBA, got {legend_image.mode}" except ImportError: test_logger.warning("PIL not available, skipping image parsing") @@ -279,9 +235,7 @@ async def test_03_get_legend_as_png(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_04_get_legend_with_different_colormap( - self, planetarycomputer_endpoint - ): + async def test_04_get_legend_with_different_colormap(self, planetarycomputer_endpoint): """ Test getting a legend with a different color map (viridis). @@ -307,9 +261,7 @@ async def test_04_get_legend_with_different_colormap( # Verify PNG magic bytes png_magic = b"\x89PNG\r\n\x1a\n" assert len(legend_bytes) > 0, "Legend bytes should not be empty" - assert ( - len(legend_bytes) > 100 - ), f"Legend should be substantial image, got only {len(legend_bytes)} bytes" + assert len(legend_bytes) > 100, f"Legend should be substantial image, got only {len(legend_bytes)} bytes" assert legend_bytes[:8] == png_magic, "Response should be a valid PNG image" # Parse and validate the PNG image @@ -350,9 +302,7 @@ async def test_05_class_map_legend_structure(self, planetarycomputer_endpoint): client = self.create_client(endpoint=planetarycomputer_endpoint) - test_logger.info( - f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})" - ) + test_logger.info(f"Calling: get_class_map_legend(classmap_name={ColorMapNames.MTBS_SEVERITY})") response = await client.data.get_class_map_legend( classmap_name=ColorMapNames.MTBS_SEVERITY, ) @@ -376,18 +326,12 @@ async def test_05_class_map_legend_structure(self, planetarycomputer_endpoint): ), "All color components should be integers 0-255" # Validate that different classes have different colors (except transparent) - non_transparent_colors = [ - tuple(c) for c in all_colors if c[3] != 0 - ] # Exclude transparent + non_transparent_colors = [tuple(c) for c in all_colors if c[3] != 0] # Exclude transparent # Convert to set to check uniqueness unique_colors = set(non_transparent_colors) - assert ( - len(unique_colors) > 1 - ), "Non-transparent classes should have different colors" + assert len(unique_colors) > 1, "Non-transparent classes should have different colors" - test_logger.info( - f"Found {len(response)} classes with {len(unique_colors)} unique non-transparent colors" - ) + test_logger.info(f"Found {len(response)} classes with {len(unique_colors)} unique non-transparent colors") test_logger.info("Test PASSED\n") await self.close_client() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle.py index c1d9d80d48a9..0af01422b100 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle.py @@ -56,28 +56,18 @@ def test_01_begin_create_collection(self, planetarycomputer_endpoint): # Check if collection exists and delete it first try: - existing_collection = client.stac.get_collection( - collection_id=test_collection_id - ) + existing_collection = client.stac.get_collection(collection_id=test_collection_id) if existing_collection: - test_logger.info( - f"Collection '{test_collection_id}' already exists, deleting first..." - ) - delete_poller = client.stac.begin_delete_collection( - collection_id=test_collection_id, polling=True - ) + test_logger.info(f"Collection '{test_collection_id}' already exists, deleting first...") + delete_poller = client.stac.begin_delete_collection(collection_id=test_collection_id, polling=True) delete_poller.result() test_logger.info(f"Deleted existing collection '{test_collection_id}'") except Exception: - test_logger.info( - f"Collection '{test_collection_id}' does not exist, proceeding with creation" - ) + test_logger.info(f"Collection '{test_collection_id}' does not exist, proceeding with creation") # Define collection extents spatial_extent = StacExtensionSpatialExtent(bounding_box=[[-180, -90, 180, 90]]) - temporal_extent = StacCollectionTemporalExtent( - interval=[["2020-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]] - ) + temporal_extent = StacCollectionTemporalExtent(interval=[["2020-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]]) extent = StacExtensionExtent(spatial=spatial_extent, temporal=temporal_extent) # Create collection payload @@ -93,15 +83,11 @@ def test_01_begin_create_collection(self, planetarycomputer_endpoint): } test_logger.info("Calling: begin_create_collection(body=collection_data)") - create_poller = client.stac.begin_create_collection( - body=collection_data, polling=True - ) + create_poller = client.stac.begin_create_collection(body=collection_data, polling=True) result = create_poller.result() test_logger.info(f"Collection created: {result}") - created_collection = client.stac.get_collection( - collection_id=test_collection_id - ) + created_collection = client.stac.get_collection(collection_id=test_collection_id) assert created_collection is not None assert created_collection.id == test_collection_id assert created_collection.title == "Test Collection Lifecycle" @@ -110,12 +96,12 @@ def test_01_begin_create_collection(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy - def test_02_create_or_replace_collection(self, planetarycomputer_endpoint): + def test_02_replace_collection(self, planetarycomputer_endpoint): """ - Test updating a collection using create or replace. + Test updating a collection using replace. """ test_logger.info("=" * 80) - test_logger.info("TEST: test_02_create_or_replace_collection") + test_logger.info("TEST: test_02_replace_collection") test_logger.info("=" * 80) client = self.create_client(endpoint=planetarycomputer_endpoint) @@ -128,21 +114,12 @@ def test_02_create_or_replace_collection(self, planetarycomputer_endpoint): # Update description collection.description = "Test collection for lifecycle operations - UPDATED" - test_logger.info( - f"Calling: create_or_replace_collection(collection_id='{test_collection_id}', body=collection)" - ) - updated_collection = client.stac.create_or_replace_collection( - collection_id=test_collection_id, body=collection - ) + test_logger.info(f"Calling: replace_collection(collection_id='{test_collection_id}', body=collection)") + updated_collection = client.stac.replace_collection(collection_id=test_collection_id, body=collection) test_logger.info(f"Collection updated: {updated_collection}") - updated_collection = client.stac.get_collection( - collection_id=test_collection_id - ) - assert ( - updated_collection.description - == "Test collection for lifecycle operations - UPDATED" - ) + updated_collection = client.stac.get_collection(collection_id=test_collection_id) + assert updated_collection.description == "Test collection for lifecycle operations - UPDATED" test_logger.info("Test PASSED\n") @@ -160,12 +137,8 @@ def test_03_begin_delete_collection(self, planetarycomputer_endpoint): test_collection_id = "test-collection-lifecycle" - test_logger.info( - f"Calling: begin_delete_collection(collection_id='{test_collection_id}')" - ) - delete_poller = client.stac.begin_delete_collection( - collection_id=test_collection_id, polling=True - ) + test_logger.info(f"Calling: begin_delete_collection(collection_id='{test_collection_id}')") + delete_poller = client.stac.begin_delete_collection(collection_id=test_collection_id, polling=True) result = delete_poller.result() test_logger.info(f"Delete operation completed: {result}") @@ -175,17 +148,13 @@ def test_03_begin_delete_collection(self, planetarycomputer_endpoint): assert False, "Collection should have been deleted" except Exception as e: test_logger.info(f"Collection successfully deleted (404 expected): {e}") - assert ( - "404" in str(e) or "Not Found" in str(e) or "ResourceNotFound" in str(e) - ) + assert "404" in str(e) or "Not Found" in str(e) or "ResourceNotFound" in str(e) test_logger.info("Test PASSED\n") @PlanetaryComputerPreparer() @recorded_by_proxy - def test_04_create_collection_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_04_create_collection_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating a collection asset. Note: This test uses the existing test collection. @@ -201,22 +170,12 @@ def test_04_create_collection_asset( # Delete the asset if it already exists try: - test_logger.info( - "Checking if asset 'test-asset' already exists and deleting if found..." - ) - client.stac.delete_collection_asset( - collection_id=planetarycomputer_collection_id, asset_id="test-asset" - ) + test_logger.info("Checking if asset 'test-asset' already exists and deleting if found...") + client.stac.delete_collection_asset(collection_id=planetarycomputer_collection_id, asset_id="test-asset") test_logger.info("Deleted existing 'test-asset'") except Exception as e: - if ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ): - test_logger.info( - "Asset 'test-asset' does not exist, proceeding with creation" - ) + if "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower(): + test_logger.info("Asset 'test-asset' does not exist, proceeding with creation") else: test_logger.warning(f"Error checking/deleting asset: {e}") @@ -246,9 +205,7 @@ def test_04_create_collection_asset( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_05_replace_collection_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_05_replace_collection_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a collection asset. """ @@ -272,7 +229,7 @@ def test_05_replace_collection_asset( file_tuple = ("test-asset.txt", file_content) test_logger.info( - f"Calling: create_or_replace_collection_asset(collection_id='{planetarycomputer_collection_id}', asset_id='test-asset', body={{...}})" + f"Calling: replace_collection_asset(collection_id='{planetarycomputer_collection_id}', asset_id='test-asset', body={{...}})" ) response = client.stac.replace_collection_asset( collection_id=planetarycomputer_collection_id, @@ -287,9 +244,7 @@ def test_05_replace_collection_asset( @PlanetaryComputerPreparer() @recorded_by_proxy - def test_06_delete_collection_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + def test_06_delete_collection_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a collection asset. First creates an asset specifically for deletion. @@ -336,12 +291,8 @@ def test_06_delete_collection_asset( test_logger.info("Asset deleted successfully") # Verify deletion by checking collection assets - collection = client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = client.stac.get_collection(collection_id=planetarycomputer_collection_id) if hasattr(collection, "assets") and collection.assets: - assert ( - "test-asset-to-be-deleted" not in collection.assets - ), "Asset should have been deleted" + assert "test-asset-to-be-deleted" not in collection.assets, "Asset should have been deleted" test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py index 428f562e07d2..19fe7b6dbfa0 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py @@ -39,9 +39,7 @@ test_logger.addHandler(file_handler) -class TestPlanetaryComputerCollectionLifecycleAsync( - PlanetaryComputerProClientTestBaseAsync -): +class TestPlanetaryComputerCollectionLifecycleAsync(PlanetaryComputerProClientTestBaseAsync): """Test suite for STAC Collection lifecycle operations.""" @PlanetaryComputerPreparer() @@ -60,28 +58,20 @@ async def test_01_begin_create_collection(self, planetarycomputer_endpoint): # Check if collection exists and delete it first try: - existing_collection = await client.stac.get_collection( - collection_id=test_collection_id - ) + existing_collection = await client.stac.get_collection(collection_id=test_collection_id) if existing_collection: - test_logger.info( - f"Collection '{test_collection_id}' already exists, deleting first..." - ) + test_logger.info(f"Collection '{test_collection_id}' already exists, deleting first...") delete_poller = await client.stac.begin_delete_collection( collection_id=test_collection_id, polling=True ) await delete_poller.result() test_logger.info(f"Deleted existing collection '{test_collection_id}'") except Exception: - test_logger.info( - f"Collection '{test_collection_id}' does not exist, proceeding with creation" - ) + test_logger.info(f"Collection '{test_collection_id}' does not exist, proceeding with creation") # Define collection extents spatial_extent = StacExtensionSpatialExtent(bounding_box=[[-180, -90, 180, 90]]) - temporal_extent = StacCollectionTemporalExtent( - interval=[["2020-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]] - ) + temporal_extent = StacCollectionTemporalExtent(interval=[["2020-01-01T00:00:00Z", "2024-12-31T23:59:59Z"]]) extent = StacExtensionExtent(spatial=spatial_extent, temporal=temporal_extent) # Create collection payload @@ -97,15 +87,21 @@ async def test_01_begin_create_collection(self, planetarycomputer_endpoint): } test_logger.info("Calling: begin_create_collection(body=collection_data)") - create_poller = await client.stac.begin_create_collection( - body=collection_data, polling=True - ) - result = await create_poller.result() + import asyncio + from azure.core.exceptions import ResourceExistsError + for attempt in range(12): + try: + create_poller = await client.stac.begin_create_collection(body=collection_data, polling=True) + result = await create_poller.result() + break + except ResourceExistsError: + test_logger.info(f"Collection still being deleted, retrying in 5s (attempt {attempt + 1}/12)") + await asyncio.sleep(5) + else: + raise RuntimeError("Failed to create collection after 12 retries") test_logger.info(f"Collection created: {result}") - created_collection = await client.stac.get_collection( - collection_id=test_collection_id - ) + created_collection = await client.stac.get_collection(collection_id=test_collection_id) assert created_collection is not None assert created_collection.id == test_collection_id assert created_collection.title == "Test Collection Lifecycle" @@ -116,12 +112,12 @@ async def test_01_begin_create_collection(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_02_create_or_replace_collection(self, planetarycomputer_endpoint): + async def test_02_replace_collection(self, planetarycomputer_endpoint): """ - Test updating a collection using create or replace. + Test updating a collection using replace. """ test_logger.info("=" * 80) - test_logger.info("TEST: test_02_create_or_replace_collection") + test_logger.info("TEST: test_02_replace_collection") test_logger.info("=" * 80) client = self.create_client(endpoint=planetarycomputer_endpoint) @@ -134,21 +130,12 @@ async def test_02_create_or_replace_collection(self, planetarycomputer_endpoint) # Update description collection.description = "Test collection for lifecycle operations - UPDATED" - test_logger.info( - f"Calling: create_or_replace_collection(collection_id='{test_collection_id}', body=collection)" - ) - updated_collection = await client.stac.create_or_replace_collection( - collection_id=test_collection_id, body=collection - ) + test_logger.info(f"Calling: replace_collection(collection_id='{test_collection_id}', body=collection)") + updated_collection = await client.stac.replace_collection(collection_id=test_collection_id, body=collection) test_logger.info(f"Collection updated: {updated_collection}") - updated_collection = await client.stac.get_collection( - collection_id=test_collection_id - ) - assert ( - updated_collection.description - == "Test collection for lifecycle operations - UPDATED" - ) + updated_collection = await client.stac.get_collection(collection_id=test_collection_id) + assert updated_collection.description == "Test collection for lifecycle operations - UPDATED" test_logger.info("Test PASSED\n") @@ -168,12 +155,8 @@ async def test_03_begin_delete_collection(self, planetarycomputer_endpoint): test_collection_id = "test-collection-lifecycle" - test_logger.info( - f"Calling: begin_delete_collection(collection_id='{test_collection_id}')" - ) - delete_poller = await client.stac.begin_delete_collection( - collection_id=test_collection_id, polling=True - ) + test_logger.info(f"Calling: begin_delete_collection(collection_id='{test_collection_id}')") + delete_poller = await client.stac.begin_delete_collection(collection_id=test_collection_id, polling=True) result = await delete_poller.result() test_logger.info(f"Delete operation completed: {result}") @@ -183,9 +166,7 @@ async def test_03_begin_delete_collection(self, planetarycomputer_endpoint): assert False, "Collection should have been deleted" except Exception as e: test_logger.info(f"Collection successfully deleted (404 expected): {e}") - assert ( - "404" in str(e) or "Not Found" in str(e) or "ResourceNotFound" in str(e) - ) + assert "404" in str(e) or "Not Found" in str(e) or "ResourceNotFound" in str(e) test_logger.info("Test PASSED\n") @@ -193,9 +174,7 @@ async def test_03_begin_delete_collection(self, planetarycomputer_endpoint): @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_04_create_collection_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_04_create_collection_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating a collection asset. Note: This test uses the existing test collection. @@ -211,22 +190,14 @@ async def test_04_create_collection_asset( # Delete the asset if it already exists try: - test_logger.info( - "Checking if asset 'test-asset' already exists and deleting if found..." - ) + test_logger.info("Checking if asset 'test-asset' already exists and deleting if found...") await client.stac.delete_collection_asset( collection_id=planetarycomputer_collection_id, asset_id="test-asset" ) test_logger.info("Deleted existing 'test-asset'") except Exception as e: - if ( - "404" in str(e) - or "Not Found" in str(e) - or "not found" in str(e).lower() - ): - test_logger.info( - "Asset 'test-asset' does not exist, proceeding with creation" - ) + if "404" in str(e) or "Not Found" in str(e) or "not found" in str(e).lower(): + test_logger.info("Asset 'test-asset' does not exist, proceeding with creation") else: test_logger.warning(f"Error checking/deleting asset: {e}") @@ -258,9 +229,7 @@ async def test_04_create_collection_asset( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_05_replace_collection_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_05_replace_collection_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test creating or replacing a collection asset. """ @@ -284,7 +253,7 @@ async def test_05_replace_collection_asset( file_tuple = ("test-asset.txt", file_content) test_logger.info( - f"Calling: create_or_replace_collection_asset(collection_id='{planetarycomputer_collection_id}', asset_id='test-asset', body={{...}})" + f"Calling: replace_collection_asset(collection_id='{planetarycomputer_collection_id}', asset_id='test-asset', body={{...}})" ) response = await client.stac.replace_collection_asset( collection_id=planetarycomputer_collection_id, @@ -301,9 +270,7 @@ async def test_05_replace_collection_asset( @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_06_delete_collection_asset( - self, planetarycomputer_endpoint, planetarycomputer_collection_id - ): + async def test_06_delete_collection_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """ Test deleting a collection asset. First creates an asset specifically for deletion. @@ -350,13 +317,9 @@ async def test_06_delete_collection_asset( test_logger.info("Asset deleted successfully") # Verify deletion by checking collection assets - collection = await client.stac.get_collection( - collection_id=planetarycomputer_collection_id - ) + collection = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) if hasattr(collection, "assets") and collection.assets: - assert ( - "test-asset-to-be-deleted" not in collection.assets - ), "Asset should have been deleted" + assert "test-asset-to-be-deleted" not in collection.assets, "Asset should have been deleted" test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py new file mode 100644 index 000000000000..cfb2193b993c --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py @@ -0,0 +1,325 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +""" +Unit tests for Collection-scoped Tiler operations. +""" +import logging +from pathlib import Path +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import PlanetaryComputerProClientTestBase, PlanetaryComputerPreparer +from azure.planetarycomputer.models import ( + TilerImageFormat, + Feature, + FeatureType, + Polygon, +) + +# Set up test logger +test_logger = logging.getLogger("test_collection_tiler") +test_logger.setLevel(logging.DEBUG) + +# Create logs directory if it doesn't exist +log_dir = Path(__file__).parent / "logs" +log_dir.mkdir(exist_ok=True) + +# File handler for test logs +log_file = log_dir / "collection_tiler_test_results.log" +file_handler = logging.FileHandler(log_file, mode="w") +file_handler.setLevel(logging.DEBUG) +formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") +file_handler.setFormatter(formatter) +test_logger.addHandler(file_handler) + + +class TestPlanetaryComputerCollectionTiler(PlanetaryComputerProClientTestBase): + """Test suite for Collection-scoped Tiler operations.""" + + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_01_get_collection_info(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection tiler info.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_01_get_collection_info") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_info( + collection_id=planetarycomputer_collection_id, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_02_get_collection_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection point data at a specific location.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_02_get_collection_point") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + # Note: assets or expression is required for point queries (returns 400 without one) + response = client.data.get_collection_point( + collection_id=planetarycomputer_collection_id, + longitude=-84.3860, + latitude=33.6760, + assets=["image"], + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection point assets at a specific location.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_03_get_collection_point_assets") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + # Note: assets or expression is required for point queries (returns 400 without one) + response = client.data.get_collection_point_assets( + collection_id=planetarycomputer_collection_id, + longitude=-84.3860, + latitude=33.6760, + assets=["image"], + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_04_get_collection_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting a collection tile.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_04_get_collection_tile") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_tile_by_scale_and_format( + collection_id=planetarycomputer_collection_id, + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4349, + y=6564, + scale=1, + format="png", + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join(response) + test_logger.info(f"Tile size: {len(image_bytes)} bytes") + + assert len(image_bytes) > 0 + assert image_bytes[:8] == b"\x89PNG\r\n\x1a\n", "Should be PNG format" + + test_logger.info("Test PASSED\n") + + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_05_get_collection_tile_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection TileJSON metadata.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_05_get_collection_tile_json") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_tile_json( + collection_id=planetarycomputer_collection_id, + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + if hasattr(response, "as_dict"): + response_dict = response.as_dict() + test_logger.info(f"TileJSON keys: {list(response_dict.keys())}") + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting a bbox crop from a collection.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_06_get_collection_bbox_crop") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_bbox_crop( + collection_id=planetarycomputer_collection_id, + minx=-84.3930, + miny=33.6798, + maxx=-84.3670, + maxy=33.7058, + format="png", + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join(response) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + + assert len(image_bytes) > 0, "Image bytes should not be empty" + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE collection lacks default mosaic metadata with assets for WMTS") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting WMTS capabilities for a collection.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_07_get_collection_wmts_capabilities") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_wmts_capabilities( + collection_id=planetarycomputer_collection_id, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + # WMTS returns XML + if isinstance(response, bytes): + assert b"WMTSCapabilities" in response or b"xml" in response + test_logger.info(f"Response size: {len(response)} bytes") + elif hasattr(response, '__iter__'): + xml_bytes = b"".join(response) + test_logger.info(f"Response size: {len(xml_bytes)} bytes") + assert len(xml_bytes) > 0 + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_08_crop_collection_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test cropping a collection by GeoJSON feature.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_08_crop_collection_feature_geo_json") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + geojson_feature = Feature( + type=FeatureType.FEATURE, + geometry=Polygon( + coordinates=[ + [ + [-84.3930, 33.6798], + [-84.3670, 33.6798], + [-84.3670, 33.7058], + [-84.3930, 33.7058], + [-84.3930, 33.6798], + ] + ] + ), + properties={}, + ) + + response = client.data.crop_collection_feature_geo_json( + collection_id=planetarycomputer_collection_id, + body=geojson_feature, + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join(response) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + + assert len(image_bytes) > 0, "Image bytes should not be empty" + + test_logger.info("Test PASSED\n") + + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_09_list_collection_tilesets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test listing tilesets for a collection.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_09_list_collection_tilesets") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.list_collection_tilesets( + collection_id=planetarycomputer_collection_id, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_10_get_collection_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection assets for a specific tile.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_10_get_collection_assets_for_tile") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_assets_for_tile( + collection_id=planetarycomputer_collection_id, + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + + @PlanetaryComputerPreparer() + @recorded_by_proxy + def test_11_get_collection_tileset_metadata(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection tileset metadata.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_11_get_collection_tileset_metadata") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = client.data.get_collection_tileset_metadata( + collection_id=planetarycomputer_collection_id, + tile_matrix_set_id="WebMercatorQuad", + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py new file mode 100644 index 000000000000..eace707b9ef2 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py @@ -0,0 +1,337 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +""" +Unit tests for Collection-scoped Tiler operations (async). +""" +import logging +from pathlib import Path +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from devtools_testutils import recorded_by_proxy +from testpreparer_async import PlanetaryComputerProClientTestBaseAsync +from testpreparer import PlanetaryComputerPreparer +from azure.planetarycomputer.models import ( + TilerImageFormat, + Feature, + FeatureType, + Polygon, +) + +# Set up test logger +test_logger = logging.getLogger("test_collection_tiler") +test_logger.setLevel(logging.DEBUG) + +# Create logs directory if it doesn't exist +log_dir = Path(__file__).parent / "logs" +log_dir.mkdir(exist_ok=True) + +# File handler for test logs +log_file = log_dir / "collection_tiler_async_test_results.log" +file_handler = logging.FileHandler(log_file, mode="w") +file_handler.setLevel(logging.DEBUG) +formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") +file_handler.setFormatter(formatter) +test_logger.addHandler(file_handler) + + +class TestPlanetaryComputerCollectionTilerAsync(PlanetaryComputerProClientTestBaseAsync): + """Test suite for Collection-scoped Tiler operations (async).""" + + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_01_get_collection_info(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection tiler info.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_01_get_collection_info") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_info( + collection_id=planetarycomputer_collection_id, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_02_get_collection_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection point data at a specific location.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_02_get_collection_point") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + # Note: assets or expression is required for point queries (returns 400 without one) + response = await client.data.get_collection_point( + collection_id=planetarycomputer_collection_id, + longitude=-84.3860, + latitude=33.6760, + assets=["image"], + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection point assets at a specific location.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_03_get_collection_point_assets") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + # Note: assets or expression is required for point queries (returns 400 without one) + response = await client.data.get_collection_point_assets( + collection_id=planetarycomputer_collection_id, + longitude=-84.3860, + latitude=33.6760, + assets=["image"], + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_04_get_collection_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting a collection tile.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_04_get_collection_tile") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_tile_by_scale_and_format( + collection_id=planetarycomputer_collection_id, + tile_matrix_set_id="WebMercatorQuad", + z=14, + x=4349, + y=6564, + scale=1, + format="png", + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join([chunk async for chunk in response]) + test_logger.info(f"Tile size: {len(image_bytes)} bytes") + + assert len(image_bytes) > 0 + assert image_bytes[:8] == b"\x89PNG\r\n\x1a\n", "Should be PNG format" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_05_get_collection_tile_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection TileJSON metadata.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_05_get_collection_tile_json") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_tile_json( + collection_id=planetarycomputer_collection_id, + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + if hasattr(response, "as_dict"): + response_dict = response.as_dict() + test_logger.info(f"TileJSON keys: {list(response_dict.keys())}") + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting a bbox crop from a collection.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_06_get_collection_bbox_crop") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_bbox_crop( + collection_id=planetarycomputer_collection_id, + minx=-84.3930, + miny=33.6798, + maxx=-84.3670, + maxy=33.7058, + format="png", + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join([chunk async for chunk in response]) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + + assert len(image_bytes) > 0, "Image bytes should not be empty" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE collection lacks default mosaic metadata with assets for WMTS") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting WMTS capabilities for a collection.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_07_get_collection_wmts_capabilities") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_wmts_capabilities( + collection_id=planetarycomputer_collection_id, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + if isinstance(response, bytes): + assert b"WMTSCapabilities" in response or b"xml" in response + test_logger.info(f"Response size: {len(response)} bytes") + elif hasattr(response, '__aiter__'): + xml_bytes = b"".join([chunk async for chunk in response]) + test_logger.info(f"Response size: {len(xml_bytes)} bytes") + assert len(xml_bytes) > 0 + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_08_crop_collection_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test cropping a collection by GeoJSON feature.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_08_crop_collection_feature_geo_json") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + geojson_feature = Feature( + type=FeatureType.FEATURE, + geometry=Polygon( + coordinates=[ + [ + [-84.3930, 33.6798], + [-84.3670, 33.6798], + [-84.3670, 33.7058], + [-84.3930, 33.7058], + [-84.3930, 33.6798], + ] + ] + ), + properties={}, + ) + + response = await client.data.crop_collection_feature_geo_json( + collection_id=planetarycomputer_collection_id, + body=geojson_feature, + assets=["image"], + asset_band_indices=["image|1,2,3"], + ) + + image_bytes = b"".join([chunk async for chunk in response]) + test_logger.info(f"Image size: {len(image_bytes)} bytes") + + assert len(image_bytes) > 0, "Image bytes should not be empty" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_09_list_collection_tilesets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test listing tilesets for a collection.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_09_list_collection_tilesets") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.list_collection_tilesets( + collection_id=planetarycomputer_collection_id, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_10_get_collection_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection assets for a specific tile.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_10_get_collection_assets_for_tile") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_assets_for_tile( + collection_id=planetarycomputer_collection_id, + tile_matrix_set_id="WebMercatorQuad", + z=13, + x=2174, + y=3282, + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + await self.close_client() + + @PlanetaryComputerPreparer() + @recorded_by_proxy_async + async def test_11_get_collection_tileset_metadata(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + """Test getting collection tileset metadata.""" + test_logger.info("=" * 80) + test_logger.info("TEST: test_11_get_collection_tileset_metadata") + test_logger.info("=" * 80) + + client = self.create_client(endpoint=planetarycomputer_endpoint) + + response = await client.data.get_collection_tileset_metadata( + collection_id=planetarycomputer_collection_id, + tile_matrix_set_id="WebMercatorQuad", + ) + + test_logger.info(f"Response type: {type(response)}") + assert response is not None, "Response should not be None" + + test_logger.info("Test PASSED\n") + await self.close_client() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/testpreparer.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/testpreparer.py index 2316702bc2cb..531b62db98a6 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/testpreparer.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/testpreparer.py @@ -25,6 +25,6 @@ def create_client(self, endpoint): EnvironmentVariableLoader, "planetarycomputer", planetarycomputer_endpoint="https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com", - planetarycomputer_collection_id="naip-atl", + planetarycomputer_collection_id="naip", planetarycomputer_item_id="ga_m_3308421_se_16_060_20211114", ) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml b/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml index 7e7c127a4dfd..d37be9986c2c 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml +++ b/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/orbital/Microsoft.PlanetaryComputer -commit: f6aac155e9a422cf0251498788e5726c3b615bf3 +commit: 7cb1cb2dee9bf64f5599d6a40ffad6bf510a71df repo: Azure/azure-rest-api-specs additionalDirectories: From 78898279818f936bc2bb21f7b6d0f87cfc79404e Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Tue, 21 Apr 2026 10:47:02 +0100 Subject: [PATCH 2/9] update conftest.py to allow geocatalogs created in dev as well for recording and playback --- .../azure-planetarycomputer/assets.json | 2 +- .../azure-planetarycomputer/test.py | 18 - .../test_cancel_all_operations.py | 165 --- .../test_collection_status_code.py | 95 -- .../test_readme_samples.py | 363 ------ .../azure-planetarycomputer/tests/conftest.py | 3 +- .../collection_lifecycle_test_results.log | 107 ++ .../collection_tiler_async_test_results.log | 50 + .../logs/collection_tiler_test_results.log | 50 + .../tests/logs/ingestion_test_results.log | 1043 +++++++++++++++++ .../tests/logs/map_legends_test_results.log | 120 ++ .../tests/logs/mosaics_tiler_test_results.log | 86 ++ .../tests/logs/sas_test_results.log | 102 ++ .../logs/stac_collection_test_results.log | 523 +++++++++ .../logs/stac_item_tiler_test_results.log | 382 ++++++ .../logs/stac_specification_test_results.log | 241 ++++ 16 files changed, 2707 insertions(+), 643 deletions(-) delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test.py delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py diff --git a/sdk/planetarycomputer/azure-planetarycomputer/assets.json b/sdk/planetarycomputer/azure-planetarycomputer/assets.json index d8936b3a51c3..f41f171297f6 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/planetarycomputer/azure-planetarycomputer", - "Tag": "python/planetarycomputer/azure-planetarycomputer_8e27bf2b7c" + "Tag": "python/planetarycomputer/azure-planetarycomputer_25472c1488" } diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test.py b/sdk/planetarycomputer/azure-planetarycomputer/test.py deleted file mode 100644 index 89dd1117f980..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/test.py +++ /dev/null @@ -1,18 +0,0 @@ -from azure.planetarycomputer import PlanetaryComputerProClient -from azure.identity import DefaultAzureCredential - -client = PlanetaryComputerProClient( - endpoint="https://pctiler2026.fsgcc8ava0apb2a5.uksouth.geocatalog.ppe.spatio.azure-test.net", - credential=DefaultAzureCredential(), -) - -# get_collection() says it returns pystac.Collection -collection = client.stac.get_collection(collection_id="karthick-example-collection") - -print(collection) - -# So you SHOULD be able to do this (pystac API): -print(collection.id) # "naip" -print(collection.title) # "NAIP Imagery" -print(collection.extent) # pystac Extent object -print(type(collection)) # diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py deleted file mode 100644 index 161a502acc01..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/test_cancel_all_operations.py +++ /dev/null @@ -1,165 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -""" -Test cancel_all_operations() scope. - -Creates two temporary collections, starts create-item LROs on both, -then calls cancel_all_operations() and checks if operations across -ALL collections get cancelled. - -Usage: - python test_cancel_all_operations.py -""" - -import time -from azure.planetarycomputer import PlanetaryComputerProClient -from azure.planetarycomputer.models import ( - StacCollection, - StacExtensionSpatialExtent, - StacCollectionTemporalExtent, - StacExtensionExtent, - StacItem, -) -from azure.identity import DefaultAzureCredential -from azure.core.exceptions import ResourceNotFoundError - -ENDPOINT = "https://stablegeo.eebtfbh5h4bffxbf.uksouth.geocatalog.spatio.azure.com" - -COLLECTION_A = "cancel-test-collection-a" -COLLECTION_B = "cancel-test-collection-b" - - -def make_item(item_id, collection_id): - return { - "stac_version": "1.0.0", - "type": "Feature", - "id": item_id, - "collection": collection_id, - "bbox": [-84.44, 33.62, -84.37, 33.69], - "geometry": { - "type": "Polygon", - "coordinates": [[[-84.37, 33.62], [-84.37, 33.69], [-84.44, 33.69], [-84.44, 33.62], [-84.37, 33.62]]], - }, - "properties": {"datetime": "2021-11-14T16:00:00Z"}, - "links": [ - { - "rel": "collection", - "type": "application/json", - "href": f"./collections/{collection_id}", - } - ], - "assets": { - "image": { - "href": "https://naipeuwest.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif", - "type": "image/tiff; application=geotiff; profile=cloud-optimized", - "roles": ["data"], - } - }, - } - - -def create_collection(client, collection_id): - try: - client.stac.get_collection(collection_id=collection_id) - print(f" {collection_id} already exists, deleting...") - client.stac.begin_delete_collection(collection_id=collection_id).result() - except ResourceNotFoundError: - pass - - col = StacCollection( - id=collection_id, - description=f"Temp collection for cancel test", - license="proprietary", - extent=StacExtensionExtent( - spatial=StacExtensionSpatialExtent(bounding_box=[[-180, -90, 180, 90]]), - temporal=StacCollectionTemporalExtent(interval=[[None, None]]), - ), - links=[], - stac_version="1.0.0", - type="Collection", - ) - client.stac.begin_create_collection(body=col).result() - print(f" Created {collection_id}") - - -def main(): - credential = DefaultAzureCredential() - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=credential) - - # Step 1: Create two collections - print("=== Step 1: Create test collections ===") - create_collection(client, COLLECTION_A) - create_collection(client, COLLECTION_B) - - # Step 2: Start item create operations on both (use polling=False to not wait) - print("\n=== Step 2: Start operations on both collections ===") - for i in range(3): - for col_id in [COLLECTION_A, COLLECTION_B]: - item = make_item(f"test-item-{col_id[-1]}-{i}", col_id) - try: - poller = client.stac.begin_create_item(collection_id=col_id, body=item, polling=False) - print(f" Started create '{item['id']}' in {col_id}") - except Exception as e: - print(f" Error starting '{item['id']}' in {col_id}: {e}") - - # Step 3: Check pending operations (only for our test collections) - print("\n=== Step 3: Operations before cancel ===") - test_collections = {COLLECTION_A, COLLECTION_B} - - ops_a = list(client.ingestion.list_operations(collection_id=COLLECTION_A)) - ops_b = list(client.ingestion.list_operations(collection_id=COLLECTION_B)) - print(f" {COLLECTION_A}: {len(ops_a)} operations") - for op in ops_a: - print(f" {op.id} | status={op.status} | type={op.type}") - print(f" {COLLECTION_B}: {len(ops_b)} operations") - for op in ops_b: - print(f" {op.id} | status={op.status} | type={op.type}") - - pending_before = [op for op in ops_a + ops_b if "PENDING" in str(op.status) or "RUNNING" in str(op.status)] - print(f"\n Pending/Running across test collections: {len(pending_before)}") - - # Step 4: Cancel all operations - print("\n=== Step 4: Calling cancel_all_operations() ===") - client.ingestion.cancel_all_operations() - print("cancel_all_operations() completed") - - # Step 5: Check operations after cancel (focused on test collections) - time.sleep(2) - print("\n=== Step 5: Operations after cancel ===") - ops_a_after = list(client.ingestion.list_operations(collection_id=COLLECTION_A)) - ops_b_after = list(client.ingestion.list_operations(collection_id=COLLECTION_B)) - print(f" {COLLECTION_A}: {len(ops_a_after)} operations") - for op in ops_a_after: - print(f" {op.id} | status={op.status} | type={op.type}") - print(f" {COLLECTION_B}: {len(ops_b_after)} operations") - for op in ops_b_after: - print(f" {op.id} | status={op.status} | type={op.type}") - - cancelled = [op for op in ops_a_after + ops_b_after if "CANCELED" in str(op.status)] - print(f"\n Cancelled across BOTH test collections: {len(cancelled)}") - if cancelled: - collections_cancelled = set(op.collection_id for op in cancelled) - print(f" Collections with cancelled ops: {collections_cancelled}") - if len(collections_cancelled) > 1: - print(" CONFIRMED: cancel_all_operations() affects MULTIPLE collections (catalog-wide)") - else: - print(" Only one collection affected") - - # Also check if ops from OTHER collections got cancelled - all_ops_after = list(client.ingestion.list_operations()) - all_cancelled = [op for op in all_ops_after if "CANCELED" in str(op.status)] - cancelled_collections = set(op.collection_id for op in all_cancelled) - print(f"\n Total CANCELED operations across catalog: {len(all_cancelled)}") - print(f" Collections with CANCELED ops: {cancelled_collections}") - - # Step 7: Cleanup - print("\n=== Step 7: Cleanup ===") - for col_id in [COLLECTION_A, COLLECTION_B]: - try: - client.stac.begin_delete_collection(collection_id=col_id).result() - print(f" Deleted {col_id}") - except Exception as e: - print(f" Cleanup {col_id}: {e}") - - -if __name__ == "__main__": - main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py b/sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py deleted file mode 100644 index 6505ddc8a4fb..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/test_collection_status_code.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Test replace_collection returns HTTP 200 for both -creating a new collection and replacing an existing one. - -Usage: - python test_collection_status_code.py -""" - -from azure.core.exceptions import ResourceNotFoundError, HttpResponseError -from azure.identity import DefaultAzureCredential -from azure.planetarycomputer import PlanetaryComputerProClient - -GEOCATALOG_ENDPOINT = "https://stablegeo.eebtfbh5h4bffxbf.uksouth.geocatalog.spatio.azure.com" -TEST_COLLECTION_ID = "test-status-code-check" - - -def capture_status_code(client, collection_id, body): - """Call replace_collection and return (result, status_code).""" - raw_response = None - - def capture_response(pipeline_response, deserialized, headers): - nonlocal raw_response - raw_response = pipeline_response.http_response - return deserialized - - result = client.stac.replace_collection( - collection_id=collection_id, - body=body, - cls=capture_response, - ) - return result, raw_response.status_code - - -def main(): - credential = DefaultAzureCredential() - client = PlanetaryComputerProClient(endpoint=GEOCATALOG_ENDPOINT, credential=credential) - - # Clean up any leftover from a previous run - try: - client.stac.get_collection(collection_id=TEST_COLLECTION_ID) - print(f"Collection '{TEST_COLLECTION_ID}' already exists, deleting first...") - client.stac.begin_delete_collection(collection_id=TEST_COLLECTION_ID).result() - print("Deleted.") - except ResourceNotFoundError: - print(f"Collection '{TEST_COLLECTION_ID}' does not exist (good, starting clean).") - - # Minimal STAC collection body - collection_body = { - "id": TEST_COLLECTION_ID, - "type": "Collection", - "title": "Test Collection for Status Code Check", - "description": "Temporary collection to verify HTTP status codes.", - "license": "proprietary", - "extent": { - "spatial": {"bbox": [[-180, -90, 180, 90]]}, - "temporal": {"interval": [["2020-01-01T00:00:00Z", None]]}, - }, - "links": [], - } - - # --- Test 1: CREATE (collection does not exist) --- - print("\n--- Test 1: CREATE new collection ---") - try: - result, status_code = capture_status_code(client, TEST_COLLECTION_ID, collection_body) - print(f"HTTP status code: {status_code}") - print(f"Collection returned: {result['id']}") - assert status_code == 200, f"Expected 200, got {status_code}" - print("PASS: create (new) returned 200") - except HttpResponseError as e: - print(f"FAIL: HttpResponseError — status {e.status_code}, message: {e.message}") - print("This may mean the service returned 201 for create, which the SDK does not accept.") - - # --- Test 2: REPLACE (collection already exists) --- - print("\n--- Test 2: REPLACE existing collection ---") - collection_body["description"] = "Updated description to test replace." - try: - result, status_code = capture_status_code(client, TEST_COLLECTION_ID, collection_body) - print(f"HTTP status code: {status_code}") - print(f"Collection returned: {result['id']}") - assert status_code == 200, f"Expected 200, got {status_code}" - print("PASS: replace (existing) returned 200") - except HttpResponseError as e: - print(f"FAIL: HttpResponseError — status {e.status_code}, message: {e.message}") - - # --- Cleanup --- - print("\n--- Cleanup ---") - try: - client.stac.begin_delete_collection(collection_id=TEST_COLLECTION_ID).result() - print(f"Deleted test collection '{TEST_COLLECTION_ID}'.") - except Exception as e: - print(f"Cleanup warning: {e}") - - -if __name__ == "__main__": - main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py b/sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py deleted file mode 100644 index 04d6155d2a05..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/test_readme_samples.py +++ /dev/null @@ -1,363 +0,0 @@ -""" -Validate that all README code samples work against the stable GeoCatalog. - -Runs each read-only sample from the README and validates mutating samples -(create/delete) in a safe lifecycle test with cleanup. - -Usage: - python test_readme_samples.py -""" - -import asyncio -import os -import traceback - -from azure.identity import DefaultAzureCredential -from azure.core.exceptions import HttpResponseError, ResourceNotFoundError - -ENDPOINT = "https://stablegeo.eebtfbh5h4bffxbf.uksouth.geocatalog.spatio.azure.com" -COLLECTION_ID = "naip" -ITEM_ID = "ga_m_3308421_se_16_060_20211114" - -results = [] - - -def run_sample(name, func): - """Run a sample and record pass/fail.""" - print(f"\n{'='*60}") - print(f"TESTING: {name}") - print(f"{'='*60}") - try: - func() - print(f"PASS: {name}") - results.append((name, "PASS", None)) - except Exception as e: - print(f"FAIL: {name} — {e}") - traceback.print_exc() - results.append((name, "FAIL", str(e))) - - -# ============================================================ -# README Sample: List STAC Collections -# ============================================================ -def test_list_collections(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - collections_response = client.stac.get_collections() - - for collection in collections_response.collections: - print(f"Collection: {collection.id}") - print(f" Title: {collection.title}") - print(f" Description: {collection.description[:100]}...") - break # Just verify the first one - - assert len(collections_response.collections) > 0, "No collections returned" - - -# ============================================================ -# README Sample: Search for STAC Items -# ============================================================ -def test_search_items(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.planetarycomputer.models import StacSearchParameters, FilterLanguage - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - search_params = StacSearchParameters( - collections=[COLLECTION_ID], - filter_lang=FilterLanguage.CQL2_JSON, - filter={ - "op": "s_intersects", - "args": [ - {"property": "geometry"}, - { - "type": "Polygon", - "coordinates": [ - [[-84.39, 33.76], [-84.37, 33.76], [-84.37, 33.78], [-84.39, 33.78], [-84.39, 33.76]] - ], - }, - ], - }, - limit=10, - ) - - search_result = client.stac.search(body=search_params) - print(f"Found {len(search_result.features)} items") - assert search_result.features is not None, "Search response missing features" - - -# ============================================================ -# README Sample: Get STAC Item Details -# ============================================================ -def test_get_item(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - item = client.stac.get_item( - collection_id=COLLECTION_ID, - item_id=ITEM_ID, - ) - - print(f"Item ID: {item.id}") - print(f"Geometry type: {item.geometry.type}") - print(f"Assets: {list(item.assets.keys())}") - - assert item.id == ITEM_ID - - -# ============================================================ -# README Sample: Create STAC Collection (lifecycle test) -# ============================================================ -def test_create_collection_lifecycle(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.planetarycomputer.models import ( - StacCollection, - StacExtensionSpatialExtent, - StacCollectionTemporalExtent, - StacExtensionExtent, - RenderOption, - TileSettings, - ) - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - test_collection_id = "readme-validation-test" - - # Cleanup if leftover from previous run - try: - client.stac.get_collection(collection_id=test_collection_id) - print(f" Cleaning up leftover collection '{test_collection_id}'...") - client.stac.begin_delete_collection(collection_id=test_collection_id).result() - except ResourceNotFoundError: - pass - - # --- Create collection (from README) --- - collection = StacCollection( - id=test_collection_id, - description="A collection of geospatial data", - license="proprietary", - extent=StacExtensionExtent( - spatial=StacExtensionSpatialExtent(bounding_box=[[-180.0, -90.0, 180.0, 90.0]]), - temporal=StacCollectionTemporalExtent(interval=[[None, None]]), - ), - links=[], - stac_version="1.0.0", - type="Collection", - ) - - poller = client.stac.begin_create_collection(body=collection) - poller.result() - print(f" Created collection: {test_collection_id}") - - # Verify it exists - created = client.stac.get_collection(collection_id=test_collection_id) - assert created.id == test_collection_id - - # --- Configure visualization (from README) --- - render_option = RenderOption( - id="true-color", - name="True Color", - type="raster-tile", - options="assets=image&rescale=0,255", - ) - client.stac.create_render_option(collection_id=test_collection_id, body=render_option) - print(" Created render option") - - tile_settings = TileSettings(min_zoom=6, max_items_per_tile=10) - client.stac.replace_tile_settings(collection_id=test_collection_id, body=tile_settings) - print(" Updated tile settings") - - for option in client.stac.list_render_options(collection_id=test_collection_id): - print(f" Render option: {option.id} - {option.name}") - - # --- Cleanup --- - client.stac.begin_delete_collection(collection_id=test_collection_id).result() - print(f" Deleted collection: {test_collection_id}") - - -# ============================================================ -# README Sample: Register and Render Mosaic Tiles -# ============================================================ -def test_register_mosaic(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - registration = client.data.register_mosaics_search( - body={ - "collections": [COLLECTION_ID], - "filter-lang": "cql2-json", - "filter": {"op": "=", "args": [{"property": "naip:year"}, "2021"]}, - } - ) - print(f"Search ID: {registration.search_id}") - assert registration.search_id is not None - - tile_json = client.data.get_searches_tile_json( - search_id=registration.search_id, - tile_matrix_set_id="WebMercatorQuad", - assets=["image"], - ) - print(f"Tile URLs: {tile_json.tiles}") - print(f"Bounds: {tile_json.bounds}") - assert tile_json.tiles is not None - - -# ============================================================ -# README Sample: Extract Point Values -# ============================================================ -def test_extract_point(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - point_data = client.data.get_item_point( - collection_id=COLLECTION_ID, - item_id=ITEM_ID, - longitude=-84.41, - latitude=33.65, - assets=["image"], - ) - - print(f"Coordinates: {point_data.coordinates}") - print(f"Band names: {point_data.band_names}") - print(f"Values: {point_data.values_property}") - assert point_data.coordinates is not None - - -# ============================================================ -# README Sample: Generate Map Tiles -# ============================================================ -def test_generate_tile(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - tile_response = client.data.get_tile( - collection_id=COLLECTION_ID, - item_id=ITEM_ID, - tile_matrix_set_id="WebMercatorQuad", - z=14, - x=4322, - y=6463, - assets=["image"], - format="png", - ) - - tile_bytes = b"".join(tile_response) - print(f"Tile size: {len(tile_bytes)} bytes") - assert len(tile_bytes) > 0, "Tile response was empty" - - -# ============================================================ -# README Sample: Generate SAS Token -# ============================================================ -def test_sas_token(): - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - token_response = client.sas.get_token( - collection_id=COLLECTION_ID, - duration_in_minutes=60, - ) - - print(f"SAS Token: {token_response.token[:50]}...") - print(f"Expiry: {token_response.expires_on}") - assert token_response.token is not None - - -# ============================================================ -# README Sample: Async Operations -# ============================================================ -def test_async_operations(): - from azure.planetarycomputer.aio import PlanetaryComputerProClient as AsyncClient - from azure.identity.aio import DefaultAzureCredential as AsyncCredential - - async def _run(): - credential = AsyncCredential() - async with AsyncClient(endpoint=ENDPOINT, credential=credential) as client: - collections_response = await client.stac.get_collections(headers={"Accept-Encoding": "identity"}) - for collection in collections_response.collections: - print(f" Async Collection: {collection.id}") - break - - item = await client.stac.get_item( - collection_id=COLLECTION_ID, - item_id=ITEM_ID, - ) - print(f" Async Item: {item.id}") - assert item.id == ITEM_ID - - await credential.close() - - asyncio.run(_run()) - - -# ============================================================ -# README Sample: Error Handling -# ============================================================ -def test_error_handling(): - from azure.core.exceptions import HttpResponseError - from azure.planetarycomputer import PlanetaryComputerProClient - from azure.identity import DefaultAzureCredential - - client = PlanetaryComputerProClient(endpoint=ENDPOINT, credential=DefaultAzureCredential()) - - try: - client.stac.get_collection(collection_id="non-existent-collection") - assert False, "Should have raised HttpResponseError" - except HttpResponseError as e: - print(f"Status code: {e.status_code}") - print(f"Reason: {e.reason}") - assert e.status_code == 404 - - -# ============================================================ -# Run all samples -# ============================================================ -def main(): - print(f"Validating README samples against: {ENDPOINT}\n") - - run_sample("List STAC Collections", test_list_collections) - run_sample("Search for STAC Items", test_search_items) - run_sample("Get STAC Item Details", test_get_item) - run_sample("Create Collection Lifecycle", test_create_collection_lifecycle) - run_sample("Register and Render Mosaic Tiles", test_register_mosaic) - run_sample("Extract Point Values", test_extract_point) - run_sample("Generate Map Tiles", test_generate_tile) - run_sample("Generate SAS Token", test_sas_token) - run_sample("Async Operations", test_async_operations) - run_sample("Error Handling", test_error_handling) - - # Summary - print(f"\n{'='*60}") - print("SUMMARY") - print(f"{'='*60}") - passed = sum(1 for _, s, _ in results if s == "PASS") - failed = sum(1 for _, s, _ in results if s == "FAIL") - for name, status, err in results: - icon = "✅" if status == "PASS" else "❌" - line = f" {icon} {name}" - if err: - line += f" — {err[:80]}" - print(line) - print(f"\n{passed}/{passed + failed} passed") - - if failed: - exit(1) - - -if __name__ == "__main__": - main() diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py index c2532a93b240..bf1121f49eec 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/conftest.py @@ -82,8 +82,9 @@ def add_sanitizers(test_proxy): fake_endpoint = "https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com" # Replace any real geocatalog hostname with our standardized fake value + # Covers both .azure.com and .azure-test.net (PPE) domains add_uri_regex_sanitizer( - regex=r"https?://[a-zA-Z0-9\-\.]+\.geocatalog\.[a-zA-Z0-9\-\.]+\.azure\.com", + regex=r"https?://[a-zA-Z0-9\-\.]+\.geocatalog\.[a-zA-Z0-9\-\.]+\.azure(?:-test)?\.(?:com|net)", value=fake_endpoint, ) add_uri_regex_sanitizer(regex=r"https?://[a-zA-Z0-9\-\.]+\.geocatalog\.azure\.com", value=fake_endpoint) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log index e69de29bb2d1..b5358794b552 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log @@ -0,0 +1,107 @@ +2026-04-21 10:39:39,085 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,085 - test_collection_lifecycle - INFO - TEST: test_01_begin_create_collection +2026-04-21 10:39:39,085 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,098 - test_collection_lifecycle - INFO - Collection 'test-collection-lifecycle' does not exist, proceeding with creation +2026-04-21 10:39:39,100 - test_collection_lifecycle - INFO - Calling: begin_create_collection(body=collection_data) +2026-04-21 10:39:39,118 - test_collection_lifecycle - INFO - Collection created: None +2026-04-21 10:39:39,124 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:39:39,134 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,134 - test_collection_lifecycle - INFO - TEST: test_02_replace_collection +2026-04-21 10:39:39,134 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,148 - test_collection_lifecycle - INFO - Calling: replace_collection(collection_id='test-collection-lifecycle', body=collection) +2026-04-21 10:39:39,154 - test_collection_lifecycle - INFO - Collection updated: {'id': 'test-collection-lifecycle', 'type': 'Collection', 'links': [{'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'items', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/items'}], 'title': 'Test Collection Lifecycle', 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2024-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'description': 'Test collection for lifecycle operations - UPDATED', 'stac_version': '1.0.0', 'msft:_created': '2026-04-21T09:35:40.375857Z', 'msft:_updated': '2026-04-21T09:35:57.4682417Z'} +2026-04-21 10:39:39,157 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:39:39,166 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,166 - test_collection_lifecycle - INFO - TEST: test_03_begin_delete_collection +2026-04-21 10:39:39,166 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,167 - test_collection_lifecycle - INFO - Calling: begin_delete_collection(collection_id='test-collection-lifecycle') +2026-04-21 10:39:39,180 - test_collection_lifecycle - INFO - Delete operation completed: None +2026-04-21 10:39:39,182 - test_collection_lifecycle - INFO - Collection successfully deleted (404 expected): (ResourceNotFound) Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. +Code: ResourceNotFound +Message: Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. +2026-04-21 10:39:39,182 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:39:39,194 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,194 - test_collection_lifecycle - INFO - TEST: test_04_create_collection_asset +2026-04-21 10:39:39,195 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,195 - test_collection_lifecycle - INFO - Checking if asset 'test-asset' already exists and deleting if found... +2026-04-21 10:39:39,208 - test_collection_lifecycle - INFO - Deleted existing 'test-asset' +2026-04-21 10:39:39,208 - test_collection_lifecycle - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) +2026-04-21 10:39:39,213 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:36:31.016110Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset', 'roles': ['metadata']}}} +2026-04-21 10:39:39,213 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - TEST: test_05_replace_collection_asset +2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - Calling: replace_collection_asset(collection_id='naip', asset_id='test-asset', body={...}) +2026-04-21 10:39:39,232 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:36:32.443371Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}}} +2026-04-21 10:39:39,232 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - TEST: test_06_delete_collection_asset +2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - Creating asset for deletion: test-asset-to-be-deleted +2026-04-21 10:39:39,258 - test_collection_lifecycle - INFO - Asset created successfully +2026-04-21 10:39:39,258 - test_collection_lifecycle - INFO - Calling: delete_collection_asset(collection_id='naip', asset_id='test-asset-to-be-deleted') +2026-04-21 10:39:39,261 - test_collection_lifecycle - INFO - Asset deleted successfully +2026-04-21 10:39:39,264 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:39:39,289 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,289 - test_collection_lifecycle - INFO - TEST: test_01_begin_create_collection +2026-04-21 10:39:39,289 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:39:39,314 - test_collection_lifecycle - INFO - Collection 'test-collection-lifecycle' does not exist, proceeding with creation +2026-04-21 10:39:39,315 - test_collection_lifecycle - INFO - Calling: begin_create_collection(body=collection_data) +2026-04-21 10:39:39,319 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 1/12) +2026-04-21 10:39:44,346 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 2/12) +2026-04-21 10:39:49,363 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 3/12) +2026-04-21 10:39:54,380 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 4/12) +2026-04-21 10:39:59,396 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 5/12) +2026-04-21 10:40:04,410 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 6/12) +2026-04-21 10:40:09,428 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 7/12) +2026-04-21 10:40:14,440 - test_collection_lifecycle - INFO - Collection created: None +2026-04-21 10:40:14,443 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:40:14,459 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,459 - test_collection_lifecycle - INFO - TEST: test_02_replace_collection +2026-04-21 10:40:14,459 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,478 - test_collection_lifecycle - INFO - Calling: replace_collection(collection_id='test-collection-lifecycle', body=collection) +2026-04-21 10:40:14,493 - test_collection_lifecycle - INFO - Collection updated: {'id': 'test-collection-lifecycle', 'type': 'Collection', 'links': [{'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'items', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/items'}], 'title': 'Test Collection Lifecycle', 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2024-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'description': 'Test collection for lifecycle operations - UPDATED', 'stac_version': '1.0.0', 'msft:_created': '2026-04-21T09:37:40.8393036Z', 'msft:_updated': '2026-04-21T09:37:45.0062545Z'} +2026-04-21 10:40:14,499 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - TEST: test_03_begin_delete_collection +2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - Calling: begin_delete_collection(collection_id='test-collection-lifecycle') +2026-04-21 10:40:14,585 - test_collection_lifecycle - INFO - Delete operation completed: None +2026-04-21 10:40:14,589 - test_collection_lifecycle - INFO - Collection successfully deleted (404 expected): (ResourceNotFound) Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. +Code: ResourceNotFound +Message: Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. +2026-04-21 10:40:14,589 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:40:14,599 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,599 - test_collection_lifecycle - INFO - TEST: test_04_create_collection_asset +2026-04-21 10:40:14,599 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,600 - test_collection_lifecycle - INFO - Checking if asset 'test-asset' already exists and deleting if found... +2026-04-21 10:40:14,625 - test_collection_lifecycle - INFO - Deleted existing 'test-asset' +2026-04-21 10:40:14,625 - test_collection_lifecycle - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) +2026-04-21 10:40:14,635 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:38:20.607442Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset', 'roles': ['metadata']}}} +2026-04-21 10:40:14,635 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - TEST: test_05_replace_collection_asset +2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - Calling: replace_collection_asset(collection_id='naip', asset_id='test-asset', body={...}) +2026-04-21 10:40:14,661 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:38:22.215021Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}}} +2026-04-21 10:40:14,661 - test_collection_lifecycle - INFO - Test PASSED + +2026-04-21 10:40:14,674 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,674 - test_collection_lifecycle - INFO - TEST: test_06_delete_collection_asset +2026-04-21 10:40:14,674 - test_collection_lifecycle - INFO - ================================================================================ +2026-04-21 10:40:14,675 - test_collection_lifecycle - INFO - Creating asset for deletion: test-asset-to-be-deleted +2026-04-21 10:40:14,696 - test_collection_lifecycle - INFO - Asset created successfully +2026-04-21 10:40:14,696 - test_collection_lifecycle - INFO - Calling: delete_collection_asset(collection_id='naip', asset_id='test-asset-to-be-deleted') +2026-04-21 10:40:14,699 - test_collection_lifecycle - INFO - Asset deleted successfully +2026-04-21 10:40:14,702 - test_collection_lifecycle - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log index e69de29bb2d1..b3655a057ba1 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log @@ -0,0 +1,50 @@ +2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,712 - test_collection_tiler - INFO - TEST: test_01_get_collection_info +2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,739 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json +2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,746 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] +2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,758 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets +2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,795 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata +2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,821 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,822 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,830 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,831 - test_collection_tiler - INFO - TEST: test_01_get_collection_info +2026-04-21 10:40:14,831 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,851 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,851 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json +2026-04-21 10:40:14,852 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,858 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,858 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] +2026-04-21 10:40:14,859 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,871 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets +2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,895 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,896 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,906 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata +2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,923 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,924 - test_collection_tiler - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log index e69de29bb2d1..b3655a057ba1 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log @@ -0,0 +1,50 @@ +2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,712 - test_collection_tiler - INFO - TEST: test_01_get_collection_info +2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,739 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json +2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,746 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] +2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,758 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets +2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,795 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata +2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,821 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,822 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,830 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,831 - test_collection_tiler - INFO - TEST: test_01_get_collection_info +2026-04-21 10:40:14,831 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,851 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,851 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json +2026-04-21 10:40:14,852 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,858 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,858 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] +2026-04-21 10:40:14,859 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,871 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets +2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,895 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,896 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,906 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata +2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 10:40:14,923 - test_collection_tiler - INFO - Response type: +2026-04-21 10:40:14,924 - test_collection_tiler - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log index e69de29bb2d1..8240cd964d6e 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log @@ -0,0 +1,1043 @@ +2026-04-21 10:39:34,349 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,350 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: List Managed Identities +2026-04-21 10:39:34,350 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,367 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,367 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create and List Ingestion Sources +2026-04-21 10:39:34,367 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,372 - test_planetary_computer_01_ingestion_management_async - WARNING - No managed identities found. Skipping test. +2026-04-21 10:39:34,387 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,387 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create SAS Token Ingestion Source +2026-04-21 10:39:34,387 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,388 - test_planetary_computer_01_ingestion_management_async - INFO - SAS Container URI: https://test.blob.core.windows.net/sas-container +2026-04-21 10:39:34,388 - test_planetary_computer_01_ingestion_management_async - INFO - SAS Token: sv=2021-01-01&st=202... +2026-04-21 10:39:34,395 - test_planetary_computer_01_ingestion_management_async - INFO - Created SAS token ingestion source: +2026-04-21 10:39:34,395 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,395 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: SharedAccessSignatureTokenIngestionSource +2026-04-21 10:39:34,398 - test_planetary_computer_01_ingestion_management_async - INFO - Cleaned up SAS source: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create Ingestion Definition +2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - Collection ID: naip +2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - Source Catalog URL: https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json +2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - Deleting all existing ingestions... +2026-04-21 10:39:34,451 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,456 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,461 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,466 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,471 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,476 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,481 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,486 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - WARNING - Failed to delete ingestion 00000000-0000-0000-0000-000000000000: (ValidationError) Cannot delete ingestion while it has active runs. Cancel the runs first. +Code: ValidationError +Message: Cannot delete ingestion while it has active runs. Cancel the runs first. +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion definition created: +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Source Catalog URL: https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Keep Original Assets: True +2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Skip Existing Items: True +2026-04-21 10:39:34,495 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion (object): 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,511 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,511 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Update Ingestion Definition +2026-04-21 10:39:34,511 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,519 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - Updated ingestion: +2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Updated Ingestion Name +2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:34,537 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,537 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create Ingestion Run +2026-04-21 10:39:34,537 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,551 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,554 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion run: +2026-04-21 10:39:34,554 - test_planetary_computer_01_ingestion_management_async - INFO - - Run ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,554 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,570 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,570 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Ingestion Run Status +2026-04-21 10:39:34,570 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,584 - test_planetary_computer_01_ingestion_management_async - INFO - Created run with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,586 - test_planetary_computer_01_ingestion_management_async - INFO - Run status: +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Total Items: 0 +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Successful Items: 0 +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Failed Items: 0 +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Pending Items: 0 +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Status History Entries: 1 +2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - Entry 1: +2026-04-21 10:39:34,601 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,601 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: List Operations +2026-04-21 10:39:34,601 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,824 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.RUNNING +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,859 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED +2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection +2026-04-21 10:39:34,907 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,907 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Operation by ID +2026-04-21 10:39:34,907 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,920 - test_planetary_computer_01_ingestion_management_async - INFO - Created operation with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - Retrieved operation: +2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:34,933 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,933 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Delete Ingestion Source +2026-04-21 10:39:34,933 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,939 - test_planetary_computer_01_ingestion_management_async - WARNING - No managed identities found. Skipping test. +2026-04-21 10:39:34,955 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,955 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Cancel Operation +2026-04-21 10:39:34,956 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,973 - test_planetary_computer_01_ingestion_management_async - INFO - Created operation with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,976 - test_planetary_computer_01_ingestion_management_async - INFO - Successfully requested cancellation for operation: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:34,989 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:34,989 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Cancel All Operations +2026-04-21 10:39:34,989 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:34,994 - test_planetary_computer_01_ingestion_management_async - INFO - Successfully requested cancellation for all operations +2026-04-21 10:39:35,006 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,006 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Source +2026-04-21 10:39:35,006 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,011 - test_planetary_computer_01_ingestion_management_async - WARNING - No managed identities found. Skipping test. +2026-04-21 10:39:35,026 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,026 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create or Replace Source +2026-04-21 10:39:35,026 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,027 - test_planetary_computer_01_ingestion_management_async - INFO - Step 1: Creating initial SAS token ingestion source with create_source... +2026-04-21 10:39:35,036 - test_planetary_computer_01_ingestion_management_async - INFO - Created SAS token ingestion source: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,036 - test_planetary_computer_01_ingestion_management_async - INFO - Step 2: First call to create_or_replace_source with existing source ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,041 - test_planetary_computer_01_ingestion_management_async - INFO - First call result: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,041 - test_planetary_computer_01_ingestion_management_async - INFO - Step 3: Second call to create_or_replace_source with updated SAS token +2026-04-21 10:39:35,044 - test_planetary_computer_01_ingestion_management_async - INFO - Second create_or_replace result (replacement): +2026-04-21 10:39:35,045 - test_planetary_computer_01_ingestion_management_async - INFO - - Response type: +2026-04-21 10:39:35,045 - test_planetary_computer_01_ingestion_management_async - INFO - - Response: {'id': '00000000-0000-0000-0000-000000000000', 'kind': 'SasToken', 'connectionInfo': {'containerUrl': 'https://SANITIZED.blob.core.windows.net/sample-container', 'expiration': '2026-04-28T09:27:04.0000000Z'}} +2026-04-21 10:39:35,064 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,064 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Lists Ingestions +2026-04-21 10:39:35,064 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,076 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for List Runs Test +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Updated Ingestion Name +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Run +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Status Check +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Operation +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Cancel Test +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Lists Test +2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,096 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,096 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Ingestion +2026-04-21 10:39:35,096 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,105 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,107 - test_planetary_computer_01_ingestion_management_async - INFO - Retrieved ingestion: +2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Get Test +2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG +2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - Source Catalog URL: https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json +2026-04-21 10:39:35,126 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,126 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: List Runs +2026-04-21 10:39:35,126 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,138 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,143 - test_planetary_computer_01_ingestion_management_async - INFO - Created run with ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,146 - test_planetary_computer_01_ingestion_management_async - INFO - Run: +2026-04-21 10:39:35,147 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,147 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:35,147 - test_planetary_computer_01_ingestion_management_async - INFO - - Total Items: 0 +2026-04-21 10:39:35,162 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,163 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Operation (Additional Coverage) +2026-04-21 10:39:35,163 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,288 - test_planetary_computer_01_ingestion_management_async - INFO - Testing with operation ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - Retrieved operation: +2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 +2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING +2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog +2026-04-21 10:39:35,312 - test_planetary_computer_01_ingestion_management_async - INFO - +================================================================================ +2026-04-21 10:39:35,312 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Cancel All Operations (Additional Coverage) +2026-04-21 10:39:35,312 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ +2026-04-21 10:39:35,318 - test_planetary_computer_01_ingestion_management_async - INFO - Successfully requested cancellation for all operations diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log index e69de29bb2d1..6f83addbfa4d 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log @@ -0,0 +1,120 @@ +2026-04-21 10:39:38,914 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,914 - test_map_legends - INFO - TEST: test_01_get_class_map_legend +2026-04-21 10:39:38,914 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,914 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,914 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY +2026-04-21 10:39:38,915 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) +2026-04-21 10:39:38,920 - test_map_legends - INFO - Response type: +2026-04-21 10:39:38,920 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} +2026-04-21 10:39:38,920 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:38,929 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,929 - test_map_legends - INFO - TEST: test_02_get_interval_legend +2026-04-21 10:39:38,929 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,930 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,930 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MODIS64_A1 +2026-04-21 10:39:38,930 - test_map_legends - INFO - Calling: get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) +2026-04-21 10:39:38,937 - test_map_legends - INFO - Response type: +2026-04-21 10:39:38,937 - test_map_legends - INFO - Response: [[[-2, 0], [0, 0, 0, 0]], [[1, 32], [255, 255, 178, 255]], [[32, 60], [255, 236, 147, 255]], [[60, 91], [254, 218, 115, 255]], [[91, 121], [254, 198, 89, 255]], [[121, 152], [254, 175, 77, 255]], [[152, 182], [253, 152, 66, 255]], [[182, 213], [251, 126, 55, 255]], [[213, 244], [246, 96, 45, 255]], [[244, 274], [241, 66, 35, 255]], [[274, 305], [226, 43, 34, 255]], [[305, 335], [208, 21, 36, 255]], [[335, 366], [189, 0, 38, 255]]] +2026-04-21 10:39:38,937 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:38,947 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,947 - test_map_legends - INFO - TEST: test_03_get_legend_as_png +2026-04-21 10:39:38,947 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,947 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,947 - test_map_legends - INFO - Input - color_map_name: rdylgn +2026-04-21 10:39:38,947 - test_map_legends - INFO - Calling: get_legend(color_map_name='rdylgn') +2026-04-21 10:39:38,953 - test_map_legends - INFO - Response type: +2026-04-21 10:39:38,954 - test_map_legends - INFO - Legend size: 550 bytes +2026-04-21 10:39:38,954 - test_map_legends - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 +2026-04-21 10:39:38,954 - test_map_legends - INFO - PNG magic bytes: 89504e470d0a1a0a +2026-04-21 10:39:38,954 - test_map_legends - INFO - Response starts with PNG magic: True +2026-04-21 10:39:38,954 - test_map_legends - INFO - PIL Image format: PNG +2026-04-21 10:39:38,954 - test_map_legends - INFO - PIL Image size: (387, 11) +2026-04-21 10:39:38,954 - test_map_legends - INFO - PIL Image mode: RGBA +2026-04-21 10:39:38,954 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:38,964 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,964 - test_map_legends - INFO - TEST: test_04_get_legend_with_different_colormap +2026-04-21 10:39:38,964 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,964 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,964 - test_map_legends - INFO - Input - color_map_name: viridis +2026-04-21 10:39:38,964 - test_map_legends - INFO - Calling: get_legend(color_map_name='viridis') +2026-04-21 10:39:38,968 - test_map_legends - INFO - Response type: +2026-04-21 10:39:38,968 - test_map_legends - INFO - Legend size: 533 bytes +2026-04-21 10:39:38,969 - test_map_legends - INFO - PIL Image format: PNG +2026-04-21 10:39:38,969 - test_map_legends - INFO - PIL Image size: (387, 11) +2026-04-21 10:39:38,969 - test_map_legends - INFO - PIL Image mode: RGBA +2026-04-21 10:39:38,969 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:38,977 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,978 - test_map_legends - INFO - TEST: test_05_class_map_legend_structure +2026-04-21 10:39:38,978 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,978 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,978 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY +2026-04-21 10:39:38,978 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) +2026-04-21 10:39:38,985 - test_map_legends - INFO - Response type: +2026-04-21 10:39:38,985 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} +2026-04-21 10:39:38,985 - test_map_legends - INFO - Found 7 classes with 6 unique non-transparent colors +2026-04-21 10:39:38,985 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:38,994 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,994 - test_map_legends - INFO - TEST: test_01_get_class_map_legend +2026-04-21 10:39:38,994 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:38,994 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,994 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY +2026-04-21 10:39:38,995 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) +2026-04-21 10:39:39,001 - test_map_legends - INFO - Response type: +2026-04-21 10:39:39,002 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} +2026-04-21 10:39:39,002 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:39,012 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,012 - test_map_legends - INFO - TEST: test_02_get_interval_legend +2026-04-21 10:39:39,013 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,013 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:39,013 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MODIS64_A1 +2026-04-21 10:39:39,013 - test_map_legends - INFO - Calling: get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) +2026-04-21 10:39:39,021 - test_map_legends - INFO - Response type: +2026-04-21 10:39:39,022 - test_map_legends - INFO - Response: [[[-2, 0], [0, 0, 0, 0]], [[1, 32], [255, 255, 178, 255]], [[32, 60], [255, 236, 147, 255]], [[60, 91], [254, 218, 115, 255]], [[91, 121], [254, 198, 89, 255]], [[121, 152], [254, 175, 77, 255]], [[152, 182], [253, 152, 66, 255]], [[182, 213], [251, 126, 55, 255]], [[213, 244], [246, 96, 45, 255]], [[244, 274], [241, 66, 35, 255]], [[274, 305], [226, 43, 34, 255]], [[305, 335], [208, 21, 36, 255]], [[335, 366], [189, 0, 38, 255]]] +2026-04-21 10:39:39,022 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:39,033 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,033 - test_map_legends - INFO - TEST: test_03_get_legend_as_png +2026-04-21 10:39:39,033 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,033 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:39,033 - test_map_legends - INFO - Input - color_map_name: rdylgn +2026-04-21 10:39:39,034 - test_map_legends - INFO - Calling: get_legend(color_map_name='rdylgn') +2026-04-21 10:39:39,038 - test_map_legends - INFO - Response type: +2026-04-21 10:39:39,039 - test_map_legends - INFO - Legend size: 550 bytes +2026-04-21 10:39:39,039 - test_map_legends - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 +2026-04-21 10:39:39,039 - test_map_legends - INFO - PNG magic bytes: 89504e470d0a1a0a +2026-04-21 10:39:39,039 - test_map_legends - INFO - Response starts with PNG magic: True +2026-04-21 10:39:39,039 - test_map_legends - INFO - PIL Image format: PNG +2026-04-21 10:39:39,039 - test_map_legends - INFO - PIL Image size: (387, 11) +2026-04-21 10:39:39,039 - test_map_legends - INFO - PIL Image mode: RGBA +2026-04-21 10:39:39,039 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:39,050 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,050 - test_map_legends - INFO - TEST: test_04_get_legend_with_different_colormap +2026-04-21 10:39:39,050 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,050 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:39,050 - test_map_legends - INFO - Input - color_map_name: viridis +2026-04-21 10:39:39,050 - test_map_legends - INFO - Calling: get_legend(color_map_name='viridis') +2026-04-21 10:39:39,055 - test_map_legends - INFO - Response type: +2026-04-21 10:39:39,055 - test_map_legends - INFO - Legend size: 533 bytes +2026-04-21 10:39:39,056 - test_map_legends - INFO - PIL Image format: PNG +2026-04-21 10:39:39,056 - test_map_legends - INFO - PIL Image size: (387, 11) +2026-04-21 10:39:39,056 - test_map_legends - INFO - PIL Image mode: RGBA +2026-04-21 10:39:39,056 - test_map_legends - INFO - Test PASSED + +2026-04-21 10:39:39,068 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,068 - test_map_legends - INFO - TEST: test_05_class_map_legend_structure +2026-04-21 10:39:39,068 - test_map_legends - INFO - ================================================================================ +2026-04-21 10:39:39,068 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:39,068 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY +2026-04-21 10:39:39,068 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) +2026-04-21 10:39:39,075 - test_map_legends - INFO - Response type: +2026-04-21 10:39:39,075 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} +2026-04-21 10:39:39,075 - test_map_legends - INFO - Found 7 classes with 6 unique non-transparent colors +2026-04-21 10:39:39,075 - test_map_legends - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log index e69de29bb2d1..e96daf74153e 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log @@ -0,0 +1,86 @@ +2026-04-21 10:39:38,677 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,677 - test_mosaics_tiler - INFO - TEST: test_01_register_mosaics_search +2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Search request: {'filter': {'op': 'and', 'args': [{'op': '=', 'args': [{'property': 'collection'}, 'naip']}, {'op': '>=', 'args': [{'property': 'datetime'}, '2021-01-01T00:00:00Z']}, {'op': '<=', 'args': [{'property': 'datetime'}, '2022-12-31T23:59:59Z']}]}, 'filter-lang': 'cql2-json', 'sortby': [{'direction': 'desc', 'field': 'datetime'}]} +2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Calling: register_mosaics_search(...) +2026-04-21 10:39:38,686 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,687 - test_mosaics_tiler - INFO - Response: {'searchid': '5bdb874db9ec386ccd82e56af5d216a3', 'links': [{'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/info', 'rel': 'metadata', 'type': 'application/json', 'title': 'Mosaic metadata'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/tilejson.json', 'rel': 'tilejson', 'type': 'application/json', 'title': 'Link for TileJSON'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/WMTSCapabilities.xml', 'rel': 'wmts', 'type': 'application/json', 'title': 'Link for WMTS'}]} +2026-04-21 10:39:38,687 - test_mosaics_tiler - INFO - Search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,687 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,695 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - TEST: test_02_get_mosaics_search_info +2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,707 - test_mosaics_tiler - INFO - Registered search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,707 - test_mosaics_tiler - INFO - Calling: get_mosaics_search_info(search_id='5bdb874db9ec386ccd82e56af5d216a3') +2026-04-21 10:39:38,711 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,711 - test_mosaics_tiler - INFO - Response keys: ['search', 'links'] +2026-04-21 10:39:38,712 - test_mosaics_tiler - INFO - Search type: +2026-04-21 10:39:38,712 - test_mosaics_tiler - INFO - Search hash: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,712 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - TEST: test_03_get_mosaics_tile_json +2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,738 - test_mosaics_tiler - INFO - Using search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,738 - test_mosaics_tiler - INFO - Calling: get_mosaics_tile_json(...) +2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - Response keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] +2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - TileJSON version: 2.2.0 +2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,760 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,760 - test_mosaics_tiler - INFO - TEST: test_11_list_searches_tilesets +2026-04-21 10:39:38,760 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,789 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,789 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - TEST: test_01_register_mosaics_search +2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,802 - test_mosaics_tiler - INFO - Search request: {'filter': {'op': 'and', 'args': [{'op': '=', 'args': [{'property': 'collection'}, 'naip']}, {'op': '>=', 'args': [{'property': 'datetime'}, '2021-01-01T00:00:00Z']}, {'op': '<=', 'args': [{'property': 'datetime'}, '2022-12-31T23:59:59Z']}]}, 'filter-lang': 'cql2-json', 'sortby': [{'direction': 'desc', 'field': 'datetime'}]} +2026-04-21 10:39:38,802 - test_mosaics_tiler - INFO - Calling: register_mosaics_search(...) +2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Response: {'searchid': '5bdb874db9ec386ccd82e56af5d216a3', 'links': [{'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/info', 'rel': 'metadata', 'type': 'application/json', 'title': 'Mosaic metadata'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/tilejson.json', 'rel': 'tilejson', 'type': 'application/json', 'title': 'Link for TileJSON'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/WMTSCapabilities.xml', 'rel': 'wmts', 'type': 'application/json', 'title': 'Link for WMTS'}]} +2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - TEST: test_02_get_mosaics_search_info +2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,834 - test_mosaics_tiler - INFO - Registered search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,834 - test_mosaics_tiler - INFO - Calling: get_mosaics_search_info(search_id='5bdb874db9ec386ccd82e56af5d216a3') +2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Response keys: ['search', 'links'] +2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Search type: +2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Search hash: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - TEST: test_03_get_mosaics_tile_json +2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,858 - test_mosaics_tiler - INFO - Using search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 10:39:38,858 - test_mosaics_tiler - INFO - Calling: get_mosaics_tile_json(...) +2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - Response keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] +2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - TileJSON version: 2.2.0 +2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,877 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,877 - test_mosaics_tiler - INFO - TEST: test_11_list_searches_tilesets +2026-04-21 10:39:38,877 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,905 - test_mosaics_tiler - INFO - Response type: +2026-04-21 10:39:38,905 - test_mosaics_tiler - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log index e69de29bb2d1..0c183ad6df0f 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log @@ -0,0 +1,102 @@ +2026-04-21 10:39:36,904 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,904 - test_sas - INFO - TEST: test_01_get_token_with_default_duration +2026-04-21 10:39:36,904 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,904 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:36,904 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:36,905 - test_sas - INFO - Calling: get_token(collection_id=naip) +2026-04-21 10:39:36,910 - test_sas - INFO - Response type: +2026-04-21 10:39:36,911 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:26Z', 'token': 'Sanitized'} +2026-04-21 10:39:36,911 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:26Z', 'token': 'Sanitized'} +2026-04-21 10:39:36,911 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:36,925 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,925 - test_sas - INFO - TEST: test_02_get_token_with_custom_duration +2026-04-21 10:39:36,925 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,925 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:36,925 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:36,925 - test_sas - INFO - Input - duration_in_minutes: 60 +2026-04-21 10:39:36,925 - test_sas - INFO - Calling: get_token(collection_id=naip, duration_in_minutes=60) +2026-04-21 10:39:36,930 - test_sas - INFO - Response type: +2026-04-21 10:39:36,930 - test_sas - INFO - Response: {'msft:expiry': '2026-04-21T10:33:27Z', 'token': 'Sanitized'} +2026-04-21 10:39:36,930 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-21T10:33:27Z', 'token': 'Sanitized'} +2026-04-21 10:39:36,931 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:36,946 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,946 - test_sas - INFO - TEST: test_03_get_sign_with_collection_thumbnail +2026-04-21 10:39:36,946 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,946 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:36,946 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:36,946 - test_sas - INFO - Getting collection... +2026-04-21 10:39:36,959 - test_sas - INFO - Original HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png +2026-04-21 10:39:36,959 - test_sas - INFO - Calling: get_sign(href=https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) +2026-04-21 10:39:36,963 - test_sas - INFO - Response type: +2026-04-21 10:39:36,963 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:28Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A25Z&ske=2026-04-28T09%3A32%3A25Z&sks=b&skv=2025-01-05&sig=Sanitized'} +2026-04-21 10:39:36,963 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:28Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A25Z&ske=2026-04-28T09%3A32%3A25Z&sks=b&skv=2025-01-05&sig=Sanitized'} +2026-04-21 10:39:36,963 - test_sas - INFO - Signed HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A25Z&ske=2026-04-28T09%3A32%3A25Z&sks=b&skv=2025-01-05&sig=Sanitized +2026-04-21 10:39:36,963 - test_sas - INFO - HREF changed: True +2026-04-21 10:39:36,963 - test_sas - INFO - Has query params: True +2026-04-21 10:39:36,963 - test_sas - INFO - Has sig param: True +2026-04-21 10:39:36,964 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:36,974 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,975 - test_sas - INFO - TEST: test_05_revoke_token +2026-04-21 10:39:36,975 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,975 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:36,975 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:36,975 - test_sas - INFO - Step 1: Generating SAS token... +2026-04-21 10:39:36,980 - test_sas - INFO - Token generated: Sanitized... +2026-04-21 10:39:36,980 - test_sas - INFO - Step 2: Revoking token... +2026-04-21 10:39:36,984 - test_sas - INFO - Token revoked successfully (no exception thrown) +2026-04-21 10:39:36,984 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:36,993 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,993 - test_sas - INFO - TEST: test_01_get_token_with_default_duration +2026-04-21 10:39:36,993 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:36,993 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:36,993 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:36,994 - test_sas - INFO - Calling: get_token(collection_id=naip) +2026-04-21 10:39:37,000 - test_sas - INFO - Response type: +2026-04-21 10:39:37,000 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:31Z', 'token': 'Sanitized'} +2026-04-21 10:39:37,001 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:31Z', 'token': 'Sanitized'} +2026-04-21 10:39:37,001 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:37,011 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:37,011 - test_sas - INFO - TEST: test_02_get_token_with_custom_duration +2026-04-21 10:39:37,011 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:37,011 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,011 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:37,011 - test_sas - INFO - Input - duration_in_minutes: 60 +2026-04-21 10:39:37,011 - test_sas - INFO - Calling: get_token(collection_id=naip, duration_in_minutes=60) +2026-04-21 10:39:37,016 - test_sas - INFO - Response type: +2026-04-21 10:39:37,017 - test_sas - INFO - Response: {'msft:expiry': '2026-04-21T10:33:33Z', 'token': 'Sanitized'} +2026-04-21 10:39:37,017 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-21T10:33:33Z', 'token': 'Sanitized'} +2026-04-21 10:39:37,017 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:37,026 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:37,027 - test_sas - INFO - TEST: test_03_get_sign_with_collection_thumbnail +2026-04-21 10:39:37,027 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:37,027 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,027 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:37,027 - test_sas - INFO - Getting collection... +2026-04-21 10:39:37,036 - test_sas - INFO - Original HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png +2026-04-21 10:39:37,037 - test_sas - INFO - Calling: get_sign(href=https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) +2026-04-21 10:39:37,040 - test_sas - INFO - Response type: +2026-04-21 10:39:37,040 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:34Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A30Z&ske=2026-04-28T09%3A32%3A30Z&sks=b&skv=2025-01-05&sig=Sanitized'} +2026-04-21 10:39:37,040 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:34Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A30Z&ske=2026-04-28T09%3A32%3A30Z&sks=b&skv=2025-01-05&sig=Sanitized'} +2026-04-21 10:39:37,040 - test_sas - INFO - Signed HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A30Z&ske=2026-04-28T09%3A32%3A30Z&sks=b&skv=2025-01-05&sig=Sanitized +2026-04-21 10:39:37,040 - test_sas - INFO - HREF changed: True +2026-04-21 10:39:37,040 - test_sas - INFO - Has query params: True +2026-04-21 10:39:37,040 - test_sas - INFO - Has sig param: True +2026-04-21 10:39:37,040 - test_sas - INFO - Test PASSED + +2026-04-21 10:39:37,053 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:37,053 - test_sas - INFO - TEST: test_05_revoke_token +2026-04-21 10:39:37,053 - test_sas - INFO - ================================================================================ +2026-04-21 10:39:37,054 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,054 - test_sas - INFO - Input - collection_id: naip +2026-04-21 10:39:37,054 - test_sas - INFO - Step 1: Generating SAS token... +2026-04-21 10:39:37,063 - test_sas - INFO - Token generated: Sanitized... +2026-04-21 10:39:37,063 - test_sas - INFO - Step 2: Revoking token... +2026-04-21 10:39:37,066 - test_sas - INFO - Token revoked successfully (no exception thrown) +2026-04-21 10:39:37,066 - test_sas - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log index e69de29bb2d1..4cd1c3bd5b30 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log @@ -0,0 +1,523 @@ +2026-04-21 10:39:04,688 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:04,688 - test_stac_collection - INFO - TEST: test_01_list_collections +2026-04-21 10:39:04,688 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:04,689 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:04,749 - test_stac_collection - INFO - Calling: get_collections() +2026-04-21 10:39:05,129 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,129 - test_stac_collection - INFO - Number of collections: 7 +2026-04-21 10:39:05,129 - test_stac_collection - INFO - First collection ID: sentinel-2 +2026-04-21 10:39:05,129 - test_stac_collection - INFO - First collection title: Sentinel-2 Test +2026-04-21 10:39:05,129 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,165 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,165 - test_stac_collection - INFO - TEST: test_02_get_conformance_class +2026-04-21 10:39:05,165 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,165 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,166 - test_stac_collection - INFO - Calling: get_conformance_class() +2026-04-21 10:39:05,188 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,188 - test_stac_collection - INFO - Response keys: ['conformsTo'] +2026-04-21 10:39:05,189 - test_stac_collection - INFO - Number of conformance classes: 15 +2026-04-21 10:39:05,189 - test_stac_collection - INFO - 1. http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2 +2026-04-21 10:39:05,189 - test_stac_collection - INFO - 2. http://www.opengis.net/spec/cql2/1.0/conf/cql2-json +2026-04-21 10:39:05,189 - test_stac_collection - INFO - 3. http://www.opengis.net/spec/cql2/1.0/conf/cql2-text +2026-04-21 10:39:05,189 - test_stac_collection - INFO - 4. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core +2026-04-21 10:39:05,189 - test_stac_collection - INFO - 5. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson +2026-04-21 10:39:05,189 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,211 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,212 - test_stac_collection - INFO - TEST: test_03_get_collection +2026-04-21 10:39:05,212 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,212 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,212 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,212 - test_stac_collection - INFO - Calling: get_collection(collection_id='naip') +2026-04-21 10:39:05,244 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,244 - test_stac_collection - INFO - Collection ID: naip +2026-04-21 10:39:05,244 - test_stac_collection - INFO - Collection Title: NAIP Test Dataset +2026-04-21 10:39:05,244 - test_stac_collection - INFO - Collection Description: NAIP imagery for SDK testing... +2026-04-21 10:39:05,244 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,260 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,261 - test_stac_collection - INFO - TEST: test_04_get_partition_type +2026-04-21 10:39:05,261 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,261 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,261 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,261 - test_stac_collection - INFO - Calling: get_partition_type(collection_id='naip') +2026-04-21 10:39:05,269 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,269 - test_stac_collection - INFO - Partition scheme: PartitionTypeScheme.NONE +2026-04-21 10:39:05,269 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,283 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,283 - test_stac_collection - INFO - TEST: test_05_list_render_options +2026-04-21 10:39:05,283 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,283 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,283 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,283 - test_stac_collection - INFO - Calling: list_render_options(collection_id='naip') +2026-04-21 10:39:05,293 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,293 - test_stac_collection - INFO - Number of render options: 2 +2026-04-21 10:39:05,293 - test_stac_collection - INFO - First render option ID: natural-color +2026-04-21 10:39:05,294 - test_stac_collection - INFO - First render option name: Natural color +2026-04-21 10:39:05,294 - test_stac_collection - INFO - First render option type: RenderOptionType.RASTER_TILE +2026-04-21 10:39:05,294 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,308 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,309 - test_stac_collection - INFO - TEST: test_06_get_tile_settings +2026-04-21 10:39:05,309 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,309 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,309 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,309 - test_stac_collection - INFO - Calling: get_tile_settings(collection_id='naip') +2026-04-21 10:39:05,318 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,318 - test_stac_collection - INFO - Response keys: ['minZoom', 'maxItemsPerTile', 'defaultLocation'] +2026-04-21 10:39:05,318 - test_stac_collection - INFO - Max items per tile: 35 +2026-04-21 10:39:05,318 - test_stac_collection - INFO - Min zoom: 6 +2026-04-21 10:39:05,318 - test_stac_collection - INFO - Default location: None +2026-04-21 10:39:05,318 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,333 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,333 - test_stac_collection - INFO - TEST: test_07_list_mosaics +2026-04-21 10:39:05,333 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,333 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,333 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,334 - test_stac_collection - INFO - Calling: list_mosaics(collection_id='naip') +2026-04-21 10:39:05,344 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,344 - test_stac_collection - INFO - Number of mosaics: 2 +2026-04-21 10:39:05,344 - test_stac_collection - INFO - First mosaic ID: default +2026-04-21 10:39:05,344 - test_stac_collection - INFO - First mosaic name: Default +2026-04-21 10:39:05,344 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,360 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,360 - test_stac_collection - INFO - TEST: test_08_get_collection_queryables +2026-04-21 10:39:05,360 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,360 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,360 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,361 - test_stac_collection - INFO - Calling: get_collection_queryables(collection_id='naip') +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Number of queryables: 4 +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 1: id +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 2: datetime +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 3: geometry +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 4: test:property +2026-04-21 10:39:05,377 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,393 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,393 - test_stac_collection - INFO - TEST: test_09_list_queryables +2026-04-21 10:39:05,393 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,393 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,394 - test_stac_collection - INFO - Calling: list_queryables() +2026-04-21 10:39:05,407 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,407 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] +2026-04-21 10:39:05,407 - test_stac_collection - INFO - Number of global queryables: 4 +2026-04-21 10:39:05,407 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,421 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,421 - test_stac_collection - INFO - TEST: test_10_get_collection_configuration +2026-04-21 10:39:05,421 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,421 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,421 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,422 - test_stac_collection - INFO - Calling: get_collection_configuration(collection_id='naip') +2026-04-21 10:39:05,437 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,438 - test_stac_collection - INFO - Response keys: ['tileSettings', 'mosaicInfo'] +2026-04-21 10:39:05,438 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,456 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,456 - test_stac_collection - INFO - TEST: test_10a_create_thumbnail_asset +2026-04-21 10:39:05,456 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,456 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,456 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,456 - test_stac_collection - INFO - Checking if asset 'thumbnail' already exists and deleting if found... +2026-04-21 10:39:05,515 - test_stac_collection - INFO - Deleted existing 'thumbnail' +2026-04-21 10:39:05,515 - test_stac_collection - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) +2026-04-21 10:39:05,530 - test_stac_collection - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:22:56.272914Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}, 'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}}} +2026-04-21 10:39:05,534 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,551 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,551 - test_stac_collection - INFO - TEST: test_11_get_collection_thumbnail +2026-04-21 10:39:05,551 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,551 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:05,551 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:05,573 - test_stac_collection - INFO - Calling: get_collection_thumbnail(collection_id='naip') +2026-04-21 10:39:05,576 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:05,576 - test_stac_collection - INFO - Thumbnail size: 75 bytes +2026-04-21 10:39:05,576 - test_stac_collection - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 +2026-04-21 10:39:05,576 - test_stac_collection - INFO - Thumbnail format: PNG +2026-04-21 10:39:05,576 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,592 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,592 - test_stac_collection - INFO - TEST: test_12_create_render_option +2026-04-21 10:39:05,592 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,605 - test_stac_collection - INFO - Render option 'test-natural-color' already exists, deleting it first +2026-04-21 10:39:05,610 - test_stac_collection - INFO - Existing render option deleted +2026-04-21 10:39:05,610 - test_stac_collection - INFO - Calling: create_render_option(collection_id='naip', body={'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) +2026-04-21 10:39:05,617 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} +2026-04-21 10:39:05,617 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,630 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,630 - test_stac_collection - INFO - TEST: test_13_get_render_option +2026-04-21 10:39:05,630 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,630 - test_stac_collection - INFO - Calling: get_render_option(collection_id='naip', render_option_id='test-natural-color') +2026-04-21 10:39:05,638 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} +2026-04-21 10:39:05,638 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,658 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,658 - test_stac_collection - INFO - TEST: test_14_replace_render_option +2026-04-21 10:39:05,658 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,658 - test_stac_collection - INFO - Calling: create_or_replace_render_option(collection_id='naip', render_option_id='test-natural-color', body={'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) +2026-04-21 10:39:05,674 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} +2026-04-21 10:39:05,674 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,690 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,690 - test_stac_collection - INFO - TEST: test_14a_delete_render_option +2026-04-21 10:39:05,691 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,691 - test_stac_collection - INFO - Creating render option for deletion: test-render-opt-delete +2026-04-21 10:39:05,717 - test_stac_collection - INFO - Render option created successfully +2026-04-21 10:39:05,717 - test_stac_collection - INFO - Calling: delete_render_option(collection_id='naip', render_option_id='test-render-opt-delete') +2026-04-21 10:39:05,725 - test_stac_collection - INFO - Render option deleted successfully +2026-04-21 10:39:05,730 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Render Option 'test-render-opt-delete' not found for collection 'naip' +Code: ResourceNotFound +Message: Render Option 'test-render-opt-delete' not found for collection 'naip' +2026-04-21 10:39:05,730 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,746 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,746 - test_stac_collection - INFO - TEST: test_15_add_mosaic +2026-04-21 10:39:05,746 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,758 - test_stac_collection - INFO - Mosaic 'test-mosaic-1' already exists, deleting it first +2026-04-21 10:39:05,764 - test_stac_collection - INFO - Existing mosaic deleted +2026-04-21 10:39:05,765 - test_stac_collection - INFO - Calling: add_mosaic(collection_id='naip', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'cql': []}) +2026-04-21 10:39:05,772 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} +2026-04-21 10:39:05,772 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,794 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,799 - test_stac_collection - INFO - TEST: test_16_get_mosaic +2026-04-21 10:39:05,799 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,800 - test_stac_collection - INFO - Calling: get_mosaic(collection_id='naip', mosaic_id='test-mosaic-1') +2026-04-21 10:39:05,807 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} +2026-04-21 10:39:05,808 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,825 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,825 - test_stac_collection - INFO - TEST: test_17_replace_mosaic +2026-04-21 10:39:05,825 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,825 - test_stac_collection - INFO - Calling: create_or_replace_mosaic(collection_id='naip', mosaic_id='test-mosaic-1', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []}) +2026-04-21 10:39:05,839 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []} +2026-04-21 10:39:05,839 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,929 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,929 - test_stac_collection - INFO - TEST: test_17a_delete_mosaic +2026-04-21 10:39:05,929 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,930 - test_stac_collection - INFO - Creating mosaic for deletion: test-mosaic-to-be-deleted +2026-04-21 10:39:05,968 - test_stac_collection - INFO - Mosaic created successfully +2026-04-21 10:39:05,968 - test_stac_collection - INFO - Calling: delete_mosaic(collection_id='naip', mosaic_id='test-mosaic-to-be-deleted') +2026-04-21 10:39:05,972 - test_stac_collection - INFO - Mosaic deleted successfully +2026-04-21 10:39:05,976 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' +Code: ResourceNotFound +Message: Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' +2026-04-21 10:39:05,976 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:05,993 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,993 - test_stac_collection - INFO - TEST: test_18_replace_partition_type +2026-04-21 10:39:05,993 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:05,993 - test_stac_collection - INFO - Creating temporary collection: test-partition-type-collection +2026-04-21 10:39:06,068 - test_stac_collection - INFO - Collection 'test-partition-type-collection' does not exist, proceeding with creation +2026-04-21 10:39:06,068 - test_stac_collection - INFO - Creating collection using begin_create_collection +2026-04-21 10:39:06,096 - test_stac_collection - INFO - Temporary collection created +2026-04-21 10:39:06,096 - test_stac_collection - INFO - Calling: replace_partition_type(collection_id='test-partition-type-collection', body={'scheme': 'year'}) +2026-04-21 10:39:06,107 - test_stac_collection - INFO - Partition type set successfully +2026-04-21 10:39:06,107 - test_stac_collection - INFO - Deleting temporary collection: test-partition-type-collection +2026-04-21 10:39:06,118 - test_stac_collection - INFO - Temporary collection deleted +2026-04-21 10:39:06,118 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,142 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,142 - test_stac_collection - INFO - TEST: test_19_replace_tile_settings +2026-04-21 10:39:06,142 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,143 - test_stac_collection - INFO - Calling: replace_tile_settings(collection_id='naip', body={'maxItemsPerTile': 35, 'minZoom': 6}) +2026-04-21 10:39:06,155 - test_stac_collection - INFO - Response: {'minZoom': 6, 'maxItemsPerTile': 35, 'defaultLocation': None} +2026-04-21 10:39:06,155 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,171 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,171 - test_stac_collection - INFO - TEST: test_20_create_queryables +2026-04-21 10:39:06,171 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,194 - test_stac_collection - INFO - Queryable 'test:property' already exists, deleting it first +2026-04-21 10:39:06,199 - test_stac_collection - INFO - Existing queryable deleted +2026-04-21 10:39:06,200 - test_stac_collection - INFO - Calling: create_queryables(collection_id='naip', body=[queryable]) +2026-04-21 10:39:06,207 - test_stac_collection - INFO - Response: [{'name': 'test:property', 'definition': {'data_type': 'number'}, 'create_index': False, 'data_type': 'number'}] +2026-04-21 10:39:06,208 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,221 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,222 - test_stac_collection - INFO - TEST: test_21_replace_queryable +2026-04-21 10:39:06,222 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,222 - test_stac_collection - INFO - Calling: create_or_replace_queryable(collection_id='naip', queryable_name='test:property', body=queryable) +2026-04-21 10:39:06,238 - test_stac_collection - INFO - Response: {'name': 'test:property', 'definition': {'description': 'Test property - updated'}, 'create_index': False, 'data_type': None} +2026-04-21 10:39:06,238 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,255 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,255 - test_stac_collection - INFO - TEST: test_21a_delete_queryable +2026-04-21 10:39:06,255 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,255 - test_stac_collection - INFO - Creating queryable for deletion: test:property_to_be_deleted +2026-04-21 10:39:06,291 - test_stac_collection - INFO - Queryable created successfully +2026-04-21 10:39:06,291 - test_stac_collection - INFO - Calling: delete_queryable(collection_id='naip', queryable_name='test:property_to_be_deleted') +2026-04-21 10:39:06,295 - test_stac_collection - INFO - Queryable deleted successfully +2026-04-21 10:39:06,302 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,323 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,323 - test_stac_collection - INFO - TEST: test_01_list_collections +2026-04-21 10:39:06,323 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,324 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,324 - test_stac_collection - INFO - Calling: get_collections() +2026-04-21 10:39:06,438 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,439 - test_stac_collection - INFO - Number of collections: 7 +2026-04-21 10:39:06,439 - test_stac_collection - INFO - First collection ID: sentinel-2 +2026-04-21 10:39:06,439 - test_stac_collection - INFO - First collection title: Sentinel-2 Test +2026-04-21 10:39:06,439 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,466 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,466 - test_stac_collection - INFO - TEST: test_02_get_conformance_class +2026-04-21 10:39:06,466 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,467 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,467 - test_stac_collection - INFO - Calling: get_conformance_class() +2026-04-21 10:39:06,479 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,479 - test_stac_collection - INFO - Response keys: ['conformsTo'] +2026-04-21 10:39:06,479 - test_stac_collection - INFO - Number of conformance classes: 15 +2026-04-21 10:39:06,479 - test_stac_collection - INFO - 1. http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2 +2026-04-21 10:39:06,479 - test_stac_collection - INFO - 2. http://www.opengis.net/spec/cql2/1.0/conf/cql2-json +2026-04-21 10:39:06,479 - test_stac_collection - INFO - 3. http://www.opengis.net/spec/cql2/1.0/conf/cql2-text +2026-04-21 10:39:06,479 - test_stac_collection - INFO - 4. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core +2026-04-21 10:39:06,479 - test_stac_collection - INFO - 5. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson +2026-04-21 10:39:06,479 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,497 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,497 - test_stac_collection - INFO - TEST: test_03_get_collection +2026-04-21 10:39:06,497 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,497 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,497 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,498 - test_stac_collection - INFO - Calling: get_collection(collection_id='naip') +2026-04-21 10:39:06,518 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,518 - test_stac_collection - INFO - Collection ID: naip +2026-04-21 10:39:06,518 - test_stac_collection - INFO - Collection Title: NAIP Test Dataset +2026-04-21 10:39:06,518 - test_stac_collection - INFO - Collection Description: NAIP imagery for SDK testing... +2026-04-21 10:39:06,518 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,543 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,543 - test_stac_collection - INFO - TEST: test_04_get_partition_type +2026-04-21 10:39:06,544 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,544 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,544 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,544 - test_stac_collection - INFO - Calling: get_partition_type(collection_id='naip') +2026-04-21 10:39:06,552 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,552 - test_stac_collection - INFO - Partition scheme: PartitionTypeScheme.NONE +2026-04-21 10:39:06,552 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,574 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,574 - test_stac_collection - INFO - TEST: test_05_list_render_options +2026-04-21 10:39:06,574 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,574 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,575 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,575 - test_stac_collection - INFO - Calling: list_render_options(collection_id='naip') +2026-04-21 10:39:06,588 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,589 - test_stac_collection - INFO - Number of render options: 2 +2026-04-21 10:39:06,589 - test_stac_collection - INFO - First render option ID: natural-color +2026-04-21 10:39:06,589 - test_stac_collection - INFO - First render option name: Natural color +2026-04-21 10:39:06,589 - test_stac_collection - INFO - First render option type: RenderOptionType.RASTER_TILE +2026-04-21 10:39:06,589 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,604 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,604 - test_stac_collection - INFO - TEST: test_06_get_tile_settings +2026-04-21 10:39:06,605 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,605 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,605 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,605 - test_stac_collection - INFO - Calling: get_tile_settings(collection_id='naip') +2026-04-21 10:39:06,613 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,614 - test_stac_collection - INFO - Response keys: ['minZoom', 'maxItemsPerTile', 'defaultLocation'] +2026-04-21 10:39:06,614 - test_stac_collection - INFO - Max items per tile: 35 +2026-04-21 10:39:06,614 - test_stac_collection - INFO - Min zoom: 6 +2026-04-21 10:39:06,614 - test_stac_collection - INFO - Default location: None +2026-04-21 10:39:06,614 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,630 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,630 - test_stac_collection - INFO - TEST: test_07_list_mosaics +2026-04-21 10:39:06,630 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,630 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,630 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,631 - test_stac_collection - INFO - Calling: list_mosaics(collection_id='naip') +2026-04-21 10:39:06,642 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,642 - test_stac_collection - INFO - Number of mosaics: 2 +2026-04-21 10:39:06,643 - test_stac_collection - INFO - First mosaic ID: default +2026-04-21 10:39:06,643 - test_stac_collection - INFO - First mosaic name: Default +2026-04-21 10:39:06,643 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,663 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,663 - test_stac_collection - INFO - TEST: test_08_get_collection_queryables +2026-04-21 10:39:06,664 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,664 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,664 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,664 - test_stac_collection - INFO - Calling: get_collection_queryables(collection_id='naip') +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Number of queryables: 4 +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 1: id +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 2: datetime +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 3: geometry +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 4: test:property +2026-04-21 10:39:06,743 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,765 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,765 - test_stac_collection - INFO - TEST: test_09_list_queryables +2026-04-21 10:39:06,765 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,765 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,766 - test_stac_collection - INFO - Calling: list_queryables() +2026-04-21 10:39:06,785 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,785 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] +2026-04-21 10:39:06,785 - test_stac_collection - INFO - Number of global queryables: 4 +2026-04-21 10:39:06,785 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,800 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,801 - test_stac_collection - INFO - TEST: test_10_get_collection_configuration +2026-04-21 10:39:06,801 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,801 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,801 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,801 - test_stac_collection - INFO - Calling: get_collection_configuration(collection_id='naip') +2026-04-21 10:39:06,823 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:06,823 - test_stac_collection - INFO - Response keys: ['tileSettings', 'mosaicInfo'] +2026-04-21 10:39:06,823 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,841 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,841 - test_stac_collection - INFO - TEST: test_10a_create_thumbnail_asset +2026-04-21 10:39:06,841 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,841 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,842 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,842 - test_stac_collection - INFO - Checking if asset 'thumbnail' already exists and deleting if found... +2026-04-21 10:39:06,916 - test_stac_collection - INFO - Deleted existing 'thumbnail' +2026-04-21 10:39:06,917 - test_stac_collection - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) +2026-04-21 10:39:06,924 - test_stac_collection - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:24:32.311624Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}, 'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}}} +2026-04-21 10:39:06,928 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:06,944 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,944 - test_stac_collection - INFO - TEST: test_11_get_collection_thumbnail +2026-04-21 10:39:06,944 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:06,944 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:06,944 - test_stac_collection - INFO - Input - collection_id: naip +2026-04-21 10:39:06,999 - test_stac_collection - INFO - Calling: get_collection_thumbnail(collection_id='naip') +2026-04-21 10:39:07,003 - test_stac_collection - INFO - Response type: +2026-04-21 10:39:07,003 - test_stac_collection - INFO - Thumbnail size: 75 bytes +2026-04-21 10:39:07,003 - test_stac_collection - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 +2026-04-21 10:39:07,003 - test_stac_collection - INFO - Thumbnail format: PNG +2026-04-21 10:39:07,003 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,020 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,024 - test_stac_collection - INFO - TEST: test_12_create_render_option +2026-04-21 10:39:07,024 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,040 - test_stac_collection - INFO - Render option 'test-natural-color' already exists, deleting it first +2026-04-21 10:39:07,045 - test_stac_collection - INFO - Existing render option deleted +2026-04-21 10:39:07,045 - test_stac_collection - INFO - Calling: create_render_option(collection_id='naip', body={'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) +2026-04-21 10:39:07,053 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} +2026-04-21 10:39:07,053 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,067 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,067 - test_stac_collection - INFO - TEST: test_13_get_render_option +2026-04-21 10:39:07,068 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,068 - test_stac_collection - INFO - Calling: get_render_option(collection_id='naip', render_option_id='test-natural-color') +2026-04-21 10:39:07,077 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} +2026-04-21 10:39:07,077 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,092 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,092 - test_stac_collection - INFO - TEST: test_14_replace_render_option +2026-04-21 10:39:07,092 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,092 - test_stac_collection - INFO - Calling: create_or_replace_render_option(collection_id='naip', render_option_id='test-natural-color', body={'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) +2026-04-21 10:39:07,121 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} +2026-04-21 10:39:07,121 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,140 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,140 - test_stac_collection - INFO - TEST: test_14a_delete_render_option +2026-04-21 10:39:07,140 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,141 - test_stac_collection - INFO - Creating render option for deletion: test-render-opt-delete +2026-04-21 10:39:07,171 - test_stac_collection - INFO - Render option created successfully +2026-04-21 10:39:07,172 - test_stac_collection - INFO - Calling: delete_render_option(collection_id='naip', render_option_id='test-render-opt-delete') +2026-04-21 10:39:07,176 - test_stac_collection - INFO - Render option deleted successfully +2026-04-21 10:39:07,180 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Render Option 'test-render-opt-delete' not found for collection 'naip' +Code: ResourceNotFound +Message: Render Option 'test-render-opt-delete' not found for collection 'naip' +2026-04-21 10:39:07,180 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,197 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,197 - test_stac_collection - INFO - TEST: test_15_add_mosaic +2026-04-21 10:39:07,197 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,213 - test_stac_collection - INFO - Mosaic 'test-mosaic-1' already exists, deleting it first +2026-04-21 10:39:07,216 - test_stac_collection - INFO - Existing mosaic deleted +2026-04-21 10:39:07,217 - test_stac_collection - INFO - Calling: add_mosaic(collection_id='naip', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'cql': []}) +2026-04-21 10:39:07,222 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} +2026-04-21 10:39:07,223 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,236 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,237 - test_stac_collection - INFO - TEST: test_16_get_mosaic +2026-04-21 10:39:07,237 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,237 - test_stac_collection - INFO - Calling: get_mosaic(collection_id='naip', mosaic_id='test-mosaic-1') +2026-04-21 10:39:07,246 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} +2026-04-21 10:39:07,247 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,261 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,261 - test_stac_collection - INFO - TEST: test_17_replace_mosaic +2026-04-21 10:39:07,261 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,262 - test_stac_collection - INFO - Calling: create_or_replace_mosaic(collection_id='naip', mosaic_id='test-mosaic-1', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []}) +2026-04-21 10:39:07,276 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []} +2026-04-21 10:39:07,276 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,291 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,291 - test_stac_collection - INFO - TEST: test_17a_delete_mosaic +2026-04-21 10:39:07,291 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,292 - test_stac_collection - INFO - Creating mosaic for deletion: test-mosaic-to-be-deleted +2026-04-21 10:39:07,315 - test_stac_collection - INFO - Mosaic created successfully +2026-04-21 10:39:07,315 - test_stac_collection - INFO - Calling: delete_mosaic(collection_id='naip', mosaic_id='test-mosaic-to-be-deleted') +2026-04-21 10:39:07,318 - test_stac_collection - INFO - Mosaic deleted successfully +2026-04-21 10:39:07,321 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' +Code: ResourceNotFound +Message: Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' +2026-04-21 10:39:07,321 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:07,337 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,337 - test_stac_collection - INFO - TEST: test_18_replace_partition_type +2026-04-21 10:39:07,337 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:07,338 - test_stac_collection - INFO - Creating temporary collection: test-partition-type-collection +2026-04-21 10:39:07,440 - test_stac_collection - INFO - Collection 'test-partition-type-collection' does not exist, proceeding with creation +2026-04-21 10:39:07,440 - test_stac_collection - INFO - Creating collection using begin_create_collection +2026-04-21 10:39:07,453 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 1/12) +2026-04-21 10:39:12,554 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 2/12) +2026-04-21 10:39:17,577 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 3/12) +2026-04-21 10:39:22,589 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 4/12) +2026-04-21 10:39:27,610 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 5/12) +2026-04-21 10:39:32,651 - test_stac_collection - INFO - Temporary collection created +2026-04-21 10:39:32,652 - test_stac_collection - INFO - Calling: replace_partition_type(collection_id='test-partition-type-collection', body={'scheme': 'year'}) +2026-04-21 10:39:32,662 - test_stac_collection - INFO - Partition type set successfully +2026-04-21 10:39:32,662 - test_stac_collection - INFO - Deleting temporary collection: test-partition-type-collection +2026-04-21 10:39:32,671 - test_stac_collection - INFO - Temporary collection deleted +2026-04-21 10:39:32,671 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:32,739 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,739 - test_stac_collection - INFO - TEST: test_19_replace_tile_settings +2026-04-21 10:39:32,740 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,741 - test_stac_collection - INFO - Calling: replace_tile_settings(collection_id='naip', body={'maxItemsPerTile': 35, 'minZoom': 6}) +2026-04-21 10:39:32,752 - test_stac_collection - INFO - Response: {'minZoom': 6, 'maxItemsPerTile': 35, 'defaultLocation': None} +2026-04-21 10:39:32,752 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:32,808 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,809 - test_stac_collection - INFO - TEST: test_20_create_queryables +2026-04-21 10:39:32,809 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,820 - test_stac_collection - INFO - Queryable 'test:property' already exists, deleting it first +2026-04-21 10:39:32,824 - test_stac_collection - INFO - Existing queryable deleted +2026-04-21 10:39:32,824 - test_stac_collection - INFO - Calling: create_queryables(collection_id='naip', body=[queryable]) +2026-04-21 10:39:32,828 - test_stac_collection - INFO - Response: [{'name': 'test:property', 'definition': {'data_type': 'number'}, 'create_index': False, 'data_type': 'number'}] +2026-04-21 10:39:32,828 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:32,847 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,847 - test_stac_collection - INFO - TEST: test_21_replace_queryable +2026-04-21 10:39:32,847 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,848 - test_stac_collection - INFO - Calling: create_or_replace_queryable(collection_id='naip', queryable_name='test:property', body=queryable) +2026-04-21 10:39:32,859 - test_stac_collection - INFO - Response: {'name': 'test:property', 'definition': {'description': 'Test property - updated'}, 'create_index': False, 'data_type': None} +2026-04-21 10:39:32,859 - test_stac_collection - INFO - Test PASSED + +2026-04-21 10:39:32,883 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,883 - test_stac_collection - INFO - TEST: test_21a_delete_queryable +2026-04-21 10:39:32,883 - test_stac_collection - INFO - ================================================================================ +2026-04-21 10:39:32,883 - test_stac_collection - INFO - Creating queryable for deletion: test:property_to_be_deleted +2026-04-21 10:39:32,900 - test_stac_collection - INFO - Queryable created successfully +2026-04-21 10:39:32,900 - test_stac_collection - INFO - Calling: delete_queryable(collection_id='naip', queryable_name='test:property_to_be_deleted') +2026-04-21 10:39:32,904 - test_stac_collection - INFO - Queryable deleted successfully +2026-04-21 10:39:32,910 - test_stac_collection - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log index e69de29bb2d1..3e59728a8b09 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log @@ -0,0 +1,382 @@ +2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - TEST: test_01_get_tile_matrix_definitions +2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - Input - tile_matrix_set_id: WebMercatorQuad +2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - Calling: get_tile_matrix_definitions(tile_matrix_set_id='WebMercatorQuad') +2026-04-21 10:39:37,116 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,116 - test_stac_item_tiler - INFO - Response keys: ['title', 'description', 'keywords', 'id', 'uri', 'orderedAxes', 'crs', 'wellKnownScaleSet', 'boundingBox', 'tileMatrices'] +2026-04-21 10:39:37,116 - test_stac_item_tiler - INFO - Number of tile matrices: 25 +2026-04-21 10:39:37,117 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - TEST: test_02_list_tile_matrices +2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,126 - test_stac_item_tiler - INFO - Calling: list_tile_matrices() +2026-04-21 10:39:37,130 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,130 - test_stac_item_tiler - INFO - Response: ['CDB1GlobalGrid', 'CanadianNAD83_LCC', 'EuropeanETRS89_LAEAQuad', 'GNOSISGlobalGrid', 'LINZAntarticaMapTilegrid', 'NZTM2000Quad', 'UPSAntarcticWGS84Quad', 'UPSArcticWGS84Quad', 'UTM31WGS84Quad', 'WGS1984Quad', 'WebMercatorQuad', 'WorldCRS84Quad', 'WorldMercatorWGS84Quad'] +2026-04-21 10:39:37,130 - test_stac_item_tiler - INFO - Number of tile matrices: 13 +2026-04-21 10:39:37,131 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - TEST: test_03_list_available_assets +2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:37,141 - test_stac_item_tiler - INFO - Calling: list_available_assets(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') +2026-04-21 10:39:37,145 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,145 - test_stac_item_tiler - INFO - Response: ['image', 'tilejson'] +2026-04-21 10:39:37,146 - test_stac_item_tiler - INFO - Number of assets: 2 +2026-04-21 10:39:37,146 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - TEST: test_04_get_bounds +2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:37,155 - test_stac_item_tiler - INFO - Calling: list_bounds(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') +2026-04-21 10:39:37,161 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,161 - test_stac_item_tiler - INFO - Response: {'bounds': [-84.44157, 33.621853, -84.370894, 33.690654]} +2026-04-21 10:39:37,162 - test_stac_item_tiler - INFO - Bounds: [-84.44157, 33.621853, -84.370894, 33.690654] +2026-04-21 10:39:37,162 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - TEST: test_05_get_preview +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - dimensions: 512x512 +2026-04-21 10:39:37,198 - test_stac_item_tiler - INFO - Calling: get_preview(...) +2026-04-21 10:39:37,203 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,207 - test_stac_item_tiler - INFO - Image size: 714799 bytes +2026-04-21 10:39:37,207 - test_stac_item_tiler - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 +2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - PIL Image format: PNG +2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - PIL Image size: (512, 512) +2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - PIL Image mode: RGBA +2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - TEST: test_06_get_info_geo_json +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Calling: get_info_geo_json(...) +2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - Response keys: ['type', 'geometry', 'properties'] +2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - type: +2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - geometry: +2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - properties: +2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - TEST: test_07_list_statistics +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Calling: list_statistics(...) +2026-04-21 10:39:37,321 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,321 - test_stac_item_tiler - INFO - Response keys: ['image_b1', 'image_b2', 'image_b3', 'image_b4'] +2026-04-21 10:39:37,321 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - TEST: test_08_get_wmts_capabilities +2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:37,334 - test_stac_item_tiler - INFO - Calling: get_wmts_capabilities(...) +2026-04-21 10:39:37,339 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,339 - test_stac_item_tiler - INFO - XML size: 8462 bytes +2026-04-21 10:39:37,339 - test_stac_item_tiler - INFO - XML first 200 chars: +2026-04-21 10:39:37,861 - test_stac_item_tiler - INFO - Response: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} +2026-04-21 10:39:37,861 - test_stac_item_tiler - INFO - Response dict keys: ['image'] +2026-04-21 10:39:37,861 - test_stac_item_tiler - INFO - Response dict: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} +2026-04-21 10:39:37,880 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,880 - test_stac_item_tiler - INFO - TEST: test_20_list_tilesets +2026-04-21 10:39:37,880 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,920 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,920 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,934 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,934 - test_stac_item_tiler - INFO - TEST: test_21_get_tileset_metadata +2026-04-21 10:39:37,934 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,950 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,951 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:37,961 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,961 - test_stac_item_tiler - INFO - TEST: test_01_get_tile_matrix_definitions +2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - Input - tile_matrix_set_id: WebMercatorQuad +2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - Calling: get_tile_matrix_definitions(tile_matrix_set_id='WebMercatorQuad') +2026-04-21 10:39:37,990 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:37,991 - test_stac_item_tiler - INFO - Response keys: ['title', 'description', 'keywords', 'id', 'uri', 'orderedAxes', 'crs', 'wellKnownScaleSet', 'boundingBox', 'tileMatrices'] +2026-04-21 10:39:37,991 - test_stac_item_tiler - INFO - Number of tile matrices: 25 +2026-04-21 10:39:37,991 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - TEST: test_02_list_tile_matrices +2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - Calling: list_tile_matrices() +2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Response: ['CDB1GlobalGrid', 'CanadianNAD83_LCC', 'EuropeanETRS89_LAEAQuad', 'GNOSISGlobalGrid', 'LINZAntarticaMapTilegrid', 'NZTM2000Quad', 'UPSAntarcticWGS84Quad', 'UPSArcticWGS84Quad', 'UTM31WGS84Quad', 'WGS1984Quad', 'WebMercatorQuad', 'WorldCRS84Quad', 'WorldMercatorWGS84Quad'] +2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Number of tile matrices: 13 +2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,042 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,042 - test_stac_item_tiler - INFO - TEST: test_03_list_available_assets +2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Calling: list_available_assets(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') +2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Response: ['image', 'tilejson'] +2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Number of assets: 2 +2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - TEST: test_04_get_bounds +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Calling: list_bounds(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') +2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Response: {'bounds': [-84.44157, 33.621853, -84.370894, 33.690654]} +2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Bounds: [-84.44157, 33.621853, -84.370894, 33.690654] +2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - TEST: test_05_get_preview +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - dimensions: 512x512 +2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Calling: get_preview(...) +2026-04-21 10:39:38,114 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - Image size: 714799 bytes +2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 +2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - PIL Image format: PNG +2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - PIL Image size: (512, 512) +2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - PIL Image mode: RGBA +2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - TEST: test_06_get_info_geo_json +2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,128 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:38,128 - test_stac_item_tiler - INFO - Calling: get_info_geo_json(...) +2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - Response keys: ['type', 'geometry', 'properties'] +2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - type: +2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - geometry: +2026-04-21 10:39:38,137 - test_stac_item_tiler - INFO - properties: +2026-04-21 10:39:38,137 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,149 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - TEST: test_07_list_statistics +2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Calling: list_statistics(...) +2026-04-21 10:39:38,162 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,163 - test_stac_item_tiler - INFO - Response keys: ['image_b1', 'image_b2', 'image_b3', 'image_b4'] +2026-04-21 10:39:38,163 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - TEST: test_08_get_wmts_capabilities +2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com +2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - Input - collection_id: naip +2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 +2026-04-21 10:39:38,175 - test_stac_item_tiler - INFO - Calling: get_wmts_capabilities(...) +2026-04-21 10:39:38,180 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,180 - test_stac_item_tiler - INFO - XML size: 8450 bytes +2026-04-21 10:39:38,181 - test_stac_item_tiler - INFO - XML first 200 chars: +2026-04-21 10:39:38,594 - test_stac_item_tiler - INFO - Response: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} +2026-04-21 10:39:38,594 - test_stac_item_tiler - INFO - Response dict keys: ['image'] +2026-04-21 10:39:38,594 - test_stac_item_tiler - INFO - Response dict: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} +2026-04-21 10:39:38,604 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,604 - test_stac_item_tiler - INFO - TEST: test_20_list_tilesets +2026-04-21 10:39:38,604 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,642 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,642 - test_stac_item_tiler - INFO - Test PASSED + +2026-04-21 10:39:38,652 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,652 - test_stac_item_tiler - INFO - TEST: test_21_get_tileset_metadata +2026-04-21 10:39:38,652 - test_stac_item_tiler - INFO - ================================================================================ +2026-04-21 10:39:38,668 - test_stac_item_tiler - INFO - Response type: +2026-04-21 10:39:38,668 - test_stac_item_tiler - INFO - Test PASSED + diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log index e69de29bb2d1..c871e18c8378 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log @@ -0,0 +1,241 @@ +2026-04-21 10:39:36,114 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,114 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Get STAC API Conformance Classes +2026-04-21 10:39:36,115 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved 15 conformance classes +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 1: http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2 +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 2: http://www.opengis.net/spec/cql2/1.0/conf/cql2-json +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 3: http://www.opengis.net/spec/cql2/1.0/conf/cql2-text +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 4: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 5: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 6: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30 +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 7: http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 8: https://api.stacspec.org/v1.0.0-rc.2/item-search#filter +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 9: https://api.stacspec.org/v1.0.0/collections +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 10: https://api.stacspec.org/v1.0.0/core +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 11: https://api.stacspec.org/v1.0.0/item-search +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 12: https://api.stacspec.org/v1.0.0/item-search#fields +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 13: https://api.stacspec.org/v1.0.0/item-search#query +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 14: https://api.stacspec.org/v1.0.0/item-search#sort +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 15: https://api.stacspec.org/v1.0.0/ogcapi-features +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: https://api.stacspec.org/v1.0.0/core +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: https://api.stacspec.org/v1.0.0/collections +2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: https://api.stacspec.org/v1.0.0/item-search +2026-04-21 10:39:36,138 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,138 - test_planetary_computer_02_stac_specification_async - INFO - TEST: List STAC Collections +2026-04-21 10:39:36,138 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved 7 collections +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - +Collection 1: +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - ID: sentinel-2 +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Title: Sentinel-2 Test +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Description: Sentinel-2 placeholder for testing +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - +Collection 2: +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - ID: landsat-8 +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Title: Landsat-8 Test +2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Description: Landsat-8 placeholder for testing +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - +Collection 3: +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - ID: dem +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Title: DEM Test +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Description: Digital Elevation Model placeholder for testing +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - +Collection 4: +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - ID: land-cover +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Title: Land Cover Test +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Description: Land cover placeholder for testing +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - +Collection 5: +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - ID: io-collection +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Title: Impact Observatory Collection +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Description: An example collection +2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: CC-BY-4.0 +2026-04-21 10:39:36,183 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,183 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Get STAC Collection (naip) +2026-04-21 10:39:36,183 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved collection: naip +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Title: NAIP Test Dataset +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Description: NAIP imagery for SDK testing... +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Extent: +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Spatial attributes: ['as_dict', 'bounding_box', 'clear', 'copy', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Temporal interval: [[datetime.datetime(2020, 1, 1, 0, 0, tzinfo=), datetime.datetime(2099, 12, 31, 23, 59, 59, tzinfo=)]] +2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Links count: 5 +2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - items: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items +2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - parent: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/ +2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - root: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/ +2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - self: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip +2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - http://www.opengis.net/def/rel/ogc/1.0/queryables: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/queryables +2026-04-21 10:39:36,212 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,212 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Search STAC Items with Spatial Filter +2026-04-21 10:39:36,212 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Search returned 5 items +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - +Item 1: +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_nw_16_060_20211114 +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Geometry type: Polygon +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - +Item 2: +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_ne_16_060_20211114 +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Geometry type: Polygon +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - +Item 3: +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308421_sw_16_060_20211114 +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Geometry type: Polygon +2026-04-21 10:39:36,279 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,279 - test_planetary_computer_02_stac_specification_async - INFO - TEST: List Items in Collection +2026-04-21 10:39:36,279 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved 10 items from collection naip +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - +Item 1: +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_sw_16_060_20211114 +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - +Item 2: +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_se_16_060_20211114 +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - +Item 3: +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_nw_16_060_20211114 +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - +Item 4: +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_ne_16_060_20211114 +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - +Item 5: +2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308422_sw_16_060_20211114 +2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,371 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,372 - test_planetary_computer_02_stac_specification_async - INFO - TEST: List Collection Queryables +2026-04-21 10:39:36,372 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved queryables for collection: naip +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Found 4 queryable properties +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 1: id +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item identifier +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 2: datetime +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Datetime +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Type: string +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 3: geometry +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item Geometry +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://geojson.org/schema/Feature.json +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 4: test:property +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Test property - updated +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 1: id +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item identifier +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 2: datetime +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Datetime +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Type: string +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 3: geometry +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item Geometry +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://geojson.org/schema/Feature.json +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 4: test:property +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Test property - updated +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 1: id +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item identifier +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 2: datetime +2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Datetime +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Type: string +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 3: geometry +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item Geometry +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://geojson.org/schema/Feature.json +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - +Queryable 4: test:property +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Description: Test property - updated +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - +Queryables schema: http://json-schema.org/draft-07/schema# +2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Queryables ID: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/queryables?api-version=2026-04-15 +2026-04-21 10:39:36,395 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,395 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Search Items with Temporal Filter +2026-04-21 10:39:36,395 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Temporal search returned 10 items +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - +Item 1: ga_m_3308429_sw_16_060_20211114 +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Datetime: 2021-11-14T16:00:00Z +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - +Item 2: ga_m_3308429_se_16_060_20211114 +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Datetime: 2021-11-14T16:00:00Z +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - +Item 3: ga_m_3308429_nw_16_060_20211114 +2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Datetime: 2021-11-14T16:00:00Z +2026-04-21 10:39:36,496 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,496 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Search Items with Sorting +2026-04-21 10:39:36,496 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Search with DESC sorting returned 5 items +2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 1: ga_m_3308429_sw_16_060_20211114 +2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 2: ga_m_3308429_se_16_060_20211114 +2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 3: ga_m_3308429_nw_16_060_20211114 +2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 4: ga_m_3308429_ne_16_060_20211114 +2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 5: ga_m_3308422_sw_16_060_20211114 +2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - +Search with ASC sorting returned 5 items +2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 1: ga_m_3308429_sw_16_060_20211114 +2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 2: ga_m_3308429_se_16_060_20211114 +2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 3: ga_m_3308429_nw_16_060_20211114 +2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 4: ga_m_3308429_ne_16_060_20211114 +2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 5: ga_m_3308422_sw_16_060_20211114 +2026-04-21 10:39:36,604 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,604 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Create STAC Item +2026-04-21 10:39:36,604 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,605 - test_planetary_computer_02_stac_specification_async - INFO - Creating STAC item: ga_m_3308421_se_16_060_20211114_test +2026-04-21 10:39:36,701 - test_planetary_computer_02_stac_specification_async - INFO - Item ga_m_3308421_se_16_060_20211114_test already exists. Deleting it first... +2026-04-21 10:39:36,709 - test_planetary_computer_02_stac_specification_async - INFO - Deleted existing item ga_m_3308421_se_16_060_20211114_test +2026-04-21 10:39:36,737 - test_planetary_computer_02_stac_specification_async - INFO - Successfully created item ga_m_3308421_se_16_060_20211114_test +2026-04-21 10:39:36,737 - test_planetary_computer_02_stac_specification_async - INFO - Create operation result: None +2026-04-21 10:39:36,740 - test_planetary_computer_02_stac_specification_async - INFO - Verified item creation: ga_m_3308421_se_16_060_20211114_test +2026-04-21 10:39:36,740 - test_planetary_computer_02_stac_specification_async - INFO - Created item has 1 assets +2026-04-21 10:39:36,758 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,758 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Update STAC Item +2026-04-21 10:39:36,758 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,775 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved item for update: ga_m_3308421_se_16_060_20211114_test +2026-04-21 10:39:36,776 - test_planetary_computer_02_stac_specification_async - INFO - Updating item with platform property: Imagery +2026-04-21 10:39:36,787 - test_planetary_computer_02_stac_specification_async - ERROR - Failed to update item: Operation returned an invalid status 'OK' +Content: {"id": "00000000-0000-0000-0000-000000000000","status":"Failed","statusHistory":[{"status":"Pending","timestamp":"2026-04-21T09:31:44.098937Z"},{"status":"Running","timestamp":"2026-04-21T09:31:44.389506Z"},{"status":"Failed","timestamp":"2026-04-21T09:31:49.991125Z","errorCode":"IngestionResourceForbidden","errorMessage":"Asset transformation exception. Reason: Error retrieving content from sas token source. Reason: Forbidden access. You do not have permission to access this resource. Verify your access control settings, role assignments, SAS Token or that the managed identity has the required permissions. Learn more about access control: https://aka.ms/mpcpro-ingestion-source. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif"}],"type":"UpdateItem","creationTime":"2026-04-21T09:31:44.098937Z","startTime":"2026-04-21T09:31:44.098937Z","finishTime":"2026-04-21T09:31:49.991125Z","collectionId":"naip","additionalInformation":{"TotalFailedItems":"1","TotalItems":"1","TotalPendingItems":"0","TotalSuccessfulItems":"0"},"error":{"error":{"code":"IngestionResourceForbidden","message":"Asset transformation exception. Reason: Error retrieving content from sas token source. Reason: Forbidden access. You do not have permission to access this resource. Verify your access control settings, role assignments, SAS Token or that the managed identity has the required permissions. Learn more about access control: https://aka.ms/mpcpro-ingestion-source. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif"}}} +2026-04-21 10:39:36,787 - test_planetary_computer_02_stac_specification_async - INFO - Item update may not be supported in this environment or item doesn't exist +2026-04-21 10:39:36,788 - test_planetary_computer_02_stac_specification_async - INFO - This is expected if public access is restricted on the storage account +2026-04-21 10:39:36,803 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,803 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Get STAC Item +2026-04-21 10:39:36,803 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,822 - test_planetary_computer_02_stac_specification_async - INFO - Getting item: ga_m_3308429_sw_16_060_20211114 +2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved item: ga_m_3308429_sw_16_060_20211114 +2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip +2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Assets (4): image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Found common assets: image, tilejson, thumbnail, rendered_preview +2026-04-21 10:39:36,838 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,838 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Delete STAC Item +2026-04-21 10:39:36,839 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 10:39:36,839 - test_planetary_computer_02_stac_specification_async - INFO - Creating STAC item to delete: ga_m_3308421_se_16_060_20211114_delete_test +2026-04-21 10:39:36,873 - test_planetary_computer_02_stac_specification_async - INFO - Created item ga_m_3308421_se_16_060_20211114_delete_test +2026-04-21 10:39:36,876 - test_planetary_computer_02_stac_specification_async - INFO - Verified item ga_m_3308421_se_16_060_20211114_delete_test exists +2026-04-21 10:39:36,876 - test_planetary_computer_02_stac_specification_async - INFO - Deleting item ga_m_3308421_se_16_060_20211114_delete_test... +2026-04-21 10:39:36,883 - test_planetary_computer_02_stac_specification_async - INFO - Delete operation completed for item ga_m_3308421_se_16_060_20211114_delete_test +2026-04-21 10:39:36,883 - test_planetary_computer_02_stac_specification_async - INFO - Verifying item ga_m_3308421_se_16_060_20211114_delete_test was deleted... +2026-04-21 10:39:36,886 - test_planetary_computer_02_stac_specification_async - INFO - Verified item ga_m_3308421_se_16_060_20211114_delete_test was successfully deleted +2026-04-21 10:39:36,886 - test_planetary_computer_02_stac_specification_async - INFO - Successfully completed delete test for item ga_m_3308421_se_16_060_20211114_delete_test From 2abcd23842e23f6af08813af93deebfb10183439 Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Tue, 21 Apr 2026 20:32:04 +0100 Subject: [PATCH 3/9] Fix test_13 replace item with original asset hrefs, enable test_04 SAS download, update recordings --- .../azure-planetarycomputer/assets.json | 2 +- .../collection_tiler_async_test_results.log | 59 +---- .../logs/collection_tiler_test_results.log | 59 +---- .../tests/logs/mosaics_tiler_test_results.log | 94 +------ .../tests/logs/sas_test_results.log | 130 ++------- .../logs/stac_specification_test_results.log | 250 +----------------- ...lanetary_computer_02_stac_specification.py | 32 ++- ...ry_computer_02_stac_specification_async.py | 34 ++- .../tests/test_planetary_computer_03_sas.py | 1 - .../test_planetary_computer_03_sas_async.py | 1 - 10 files changed, 106 insertions(+), 556 deletions(-) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/assets.json b/sdk/planetarycomputer/azure-planetarycomputer/assets.json index f41f171297f6..6496dada6cbd 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/planetarycomputer/azure-planetarycomputer", - "Tag": "python/planetarycomputer/azure-planetarycomputer_25472c1488" + "Tag": "python/planetarycomputer/azure-planetarycomputer_e1b7547c7b" } diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log index b3655a057ba1..631ab8f86449 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log @@ -1,50 +1,9 @@ -2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,712 - test_collection_tiler - INFO - TEST: test_01_get_collection_info -2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,739 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json -2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,746 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] -2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,758 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets -2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,795 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata -2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,821 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,822 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,830 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,831 - test_collection_tiler - INFO - TEST: test_01_get_collection_info -2026-04-21 10:40:14,831 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,851 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,851 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json -2026-04-21 10:40:14,852 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,858 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,858 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] -2026-04-21 10:40:14,859 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,871 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets -2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,895 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,896 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,906 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata -2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,923 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,924 - test_collection_tiler - INFO - Test PASSED - +2026-04-21 11:43:42,015 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 11:43:42,016 - test_collection_tiler - INFO - TEST: test_02_get_collection_point +2026-04-21 11:43:42,016 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 11:43:45,754 - test_collection_tiler - INFO - Response type: +2026-04-21 11:43:45,755 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 11:43:46,028 - test_collection_tiler - INFO - TEST: test_02_get_collection_point +2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log index b3655a057ba1..631ab8f86449 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log @@ -1,50 +1,9 @@ -2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,712 - test_collection_tiler - INFO - TEST: test_01_get_collection_info -2026-04-21 10:40:14,712 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,728 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,739 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json -2026-04-21 10:40:14,739 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,746 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] -2026-04-21 10:40:14,746 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,758 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets -2026-04-21 10:40:14,758 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,786 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,795 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata -2026-04-21 10:40:14,795 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,821 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,822 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,830 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,831 - test_collection_tiler - INFO - TEST: test_01_get_collection_info -2026-04-21 10:40:14,831 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,839 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,851 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,851 - test_collection_tiler - INFO - TEST: test_05_get_collection_tile_json -2026-04-21 10:40:14,852 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,858 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,858 - test_collection_tiler - INFO - TileJSON keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] -2026-04-21 10:40:14,859 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,871 - test_collection_tiler - INFO - TEST: test_09_list_collection_tilesets -2026-04-21 10:40:14,871 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,895 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,896 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,906 - test_collection_tiler - INFO - TEST: test_11_get_collection_tileset_metadata -2026-04-21 10:40:14,906 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 10:40:14,923 - test_collection_tiler - INFO - Response type: -2026-04-21 10:40:14,924 - test_collection_tiler - INFO - Test PASSED - +2026-04-21 11:43:42,015 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 11:43:42,016 - test_collection_tiler - INFO - TEST: test_02_get_collection_point +2026-04-21 11:43:42,016 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 11:43:45,754 - test_collection_tiler - INFO - Response type: +2026-04-21 11:43:45,755 - test_collection_tiler - INFO - Test PASSED + +2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ +2026-04-21 11:43:46,028 - test_collection_tiler - INFO - TEST: test_02_get_collection_point +2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log index e96daf74153e..a07369fd1f72 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log @@ -1,86 +1,8 @@ -2026-04-21 10:39:38,677 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,677 - test_mosaics_tiler - INFO - TEST: test_01_register_mosaics_search -2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Search request: {'filter': {'op': 'and', 'args': [{'op': '=', 'args': [{'property': 'collection'}, 'naip']}, {'op': '>=', 'args': [{'property': 'datetime'}, '2021-01-01T00:00:00Z']}, {'op': '<=', 'args': [{'property': 'datetime'}, '2022-12-31T23:59:59Z']}]}, 'filter-lang': 'cql2-json', 'sortby': [{'direction': 'desc', 'field': 'datetime'}]} -2026-04-21 10:39:38,678 - test_mosaics_tiler - INFO - Calling: register_mosaics_search(...) -2026-04-21 10:39:38,686 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,687 - test_mosaics_tiler - INFO - Response: {'searchid': '5bdb874db9ec386ccd82e56af5d216a3', 'links': [{'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/info', 'rel': 'metadata', 'type': 'application/json', 'title': 'Mosaic metadata'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/tilejson.json', 'rel': 'tilejson', 'type': 'application/json', 'title': 'Link for TileJSON'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/WMTSCapabilities.xml', 'rel': 'wmts', 'type': 'application/json', 'title': 'Link for WMTS'}]} -2026-04-21 10:39:38,687 - test_mosaics_tiler - INFO - Search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,687 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,695 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - TEST: test_02_get_mosaics_search_info -2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,696 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,707 - test_mosaics_tiler - INFO - Registered search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,707 - test_mosaics_tiler - INFO - Calling: get_mosaics_search_info(search_id='5bdb874db9ec386ccd82e56af5d216a3') -2026-04-21 10:39:38,711 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,711 - test_mosaics_tiler - INFO - Response keys: ['search', 'links'] -2026-04-21 10:39:38,712 - test_mosaics_tiler - INFO - Search type: -2026-04-21 10:39:38,712 - test_mosaics_tiler - INFO - Search hash: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,712 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - TEST: test_03_get_mosaics_tile_json -2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,721 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,738 - test_mosaics_tiler - INFO - Using search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,738 - test_mosaics_tiler - INFO - Calling: get_mosaics_tile_json(...) -2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - Response keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] -2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - TileJSON version: 2.2.0 -2026-04-21 10:39:38,742 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,760 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,760 - test_mosaics_tiler - INFO - TEST: test_11_list_searches_tilesets -2026-04-21 10:39:38,760 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,789 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,789 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - TEST: test_01_register_mosaics_search -2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,801 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,802 - test_mosaics_tiler - INFO - Search request: {'filter': {'op': 'and', 'args': [{'op': '=', 'args': [{'property': 'collection'}, 'naip']}, {'op': '>=', 'args': [{'property': 'datetime'}, '2021-01-01T00:00:00Z']}, {'op': '<=', 'args': [{'property': 'datetime'}, '2022-12-31T23:59:59Z']}]}, 'filter-lang': 'cql2-json', 'sortby': [{'direction': 'desc', 'field': 'datetime'}]} -2026-04-21 10:39:38,802 - test_mosaics_tiler - INFO - Calling: register_mosaics_search(...) -2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Response: {'searchid': '5bdb874db9ec386ccd82e56af5d216a3', 'links': [{'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/info', 'rel': 'metadata', 'type': 'application/json', 'title': 'Mosaic metadata'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/tilejson.json', 'rel': 'tilejson', 'type': 'application/json', 'title': 'Link for TileJSON'}, {'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/data/mosaic/5bdb874db9ec386ccd82e56af5d216a3/WMTSCapabilities.xml', 'rel': 'wmts', 'type': 'application/json', 'title': 'Link for WMTS'}]} -2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,811 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - TEST: test_02_get_mosaics_search_info -2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,822 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,834 - test_mosaics_tiler - INFO - Registered search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,834 - test_mosaics_tiler - INFO - Calling: get_mosaics_search_info(search_id='5bdb874db9ec386ccd82e56af5d216a3') -2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Response keys: ['search', 'links'] -2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Search type: -2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Search hash: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,838 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - TEST: test_03_get_mosaics_tile_json -2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,848 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,858 - test_mosaics_tiler - INFO - Using search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 10:39:38,858 - test_mosaics_tiler - INFO - Calling: get_mosaics_tile_json(...) -2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - Response keys: ['tilejson', 'name', 'version', 'scheme', 'tiles', 'minzoom', 'maxzoom', 'bounds', 'center'] -2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - TileJSON version: 2.2.0 -2026-04-21 10:39:38,862 - test_mosaics_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,877 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,877 - test_mosaics_tiler - INFO - TEST: test_11_list_searches_tilesets -2026-04-21 10:39:38,877 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,905 - test_mosaics_tiler - INFO - Response type: -2026-04-21 10:39:38,905 - test_mosaics_tiler - INFO - Test PASSED - +2026-04-21 11:38:19,379 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - TEST: test_04_get_mosaics_tile +2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - ================================================================================ +2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - Input - endpoint: https://stablecat.gjehh4bsh5hdeegx.uksouth.geocatalog.ppe.spatio.azure-test.net +2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - Input - collection_id: naip +2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - Input - tile coordinates: z=13, x=2174, y=3282 +2026-04-21 11:38:21,730 - test_mosaics_tiler - INFO - Using search ID: 5bdb874db9ec386ccd82e56af5d216a3 +2026-04-21 11:38:21,730 - test_mosaics_tiler - INFO - Calling: get_mosaics_tile(...) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log index 0c183ad6df0f..752dc8148d6d 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log @@ -1,102 +1,30 @@ -2026-04-21 10:39:36,904 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,904 - test_sas - INFO - TEST: test_01_get_token_with_default_duration -2026-04-21 10:39:36,904 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,904 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:36,904 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:36,905 - test_sas - INFO - Calling: get_token(collection_id=naip) -2026-04-21 10:39:36,910 - test_sas - INFO - Response type: -2026-04-21 10:39:36,911 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:26Z', 'token': 'Sanitized'} -2026-04-21 10:39:36,911 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:26Z', 'token': 'Sanitized'} -2026-04-21 10:39:36,911 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:36,925 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,925 - test_sas - INFO - TEST: test_02_get_token_with_custom_duration -2026-04-21 10:39:36,925 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,925 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:36,925 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:36,925 - test_sas - INFO - Input - duration_in_minutes: 60 -2026-04-21 10:39:36,925 - test_sas - INFO - Calling: get_token(collection_id=naip, duration_in_minutes=60) -2026-04-21 10:39:36,930 - test_sas - INFO - Response type: -2026-04-21 10:39:36,930 - test_sas - INFO - Response: {'msft:expiry': '2026-04-21T10:33:27Z', 'token': 'Sanitized'} -2026-04-21 10:39:36,930 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-21T10:33:27Z', 'token': 'Sanitized'} -2026-04-21 10:39:36,931 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:36,946 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,946 - test_sas - INFO - TEST: test_03_get_sign_with_collection_thumbnail -2026-04-21 10:39:36,946 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,946 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:36,946 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:36,946 - test_sas - INFO - Getting collection... -2026-04-21 10:39:36,959 - test_sas - INFO - Original HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png -2026-04-21 10:39:36,959 - test_sas - INFO - Calling: get_sign(href=https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) -2026-04-21 10:39:36,963 - test_sas - INFO - Response type: -2026-04-21 10:39:36,963 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:28Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A25Z&ske=2026-04-28T09%3A32%3A25Z&sks=b&skv=2025-01-05&sig=Sanitized'} -2026-04-21 10:39:36,963 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:28Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A25Z&ske=2026-04-28T09%3A32%3A25Z&sks=b&skv=2025-01-05&sig=Sanitized'} -2026-04-21 10:39:36,963 - test_sas - INFO - Signed HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A25Z&ske=2026-04-28T09%3A32%3A25Z&sks=b&skv=2025-01-05&sig=Sanitized -2026-04-21 10:39:36,963 - test_sas - INFO - HREF changed: True -2026-04-21 10:39:36,963 - test_sas - INFO - Has query params: True -2026-04-21 10:39:36,963 - test_sas - INFO - Has sig param: True -2026-04-21 10:39:36,964 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:36,974 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,975 - test_sas - INFO - TEST: test_05_revoke_token -2026-04-21 10:39:36,975 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,975 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:36,975 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:36,975 - test_sas - INFO - Step 1: Generating SAS token... -2026-04-21 10:39:36,980 - test_sas - INFO - Token generated: Sanitized... -2026-04-21 10:39:36,980 - test_sas - INFO - Step 2: Revoking token... -2026-04-21 10:39:36,984 - test_sas - INFO - Token revoked successfully (no exception thrown) -2026-04-21 10:39:36,984 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:36,993 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,993 - test_sas - INFO - TEST: test_01_get_token_with_default_duration -2026-04-21 10:39:36,993 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:36,993 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:36,993 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:36,994 - test_sas - INFO - Calling: get_token(collection_id=naip) -2026-04-21 10:39:37,000 - test_sas - INFO - Response type: -2026-04-21 10:39:37,000 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:31Z', 'token': 'Sanitized'} -2026-04-21 10:39:37,001 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:31Z', 'token': 'Sanitized'} -2026-04-21 10:39:37,001 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:37,011 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:37,011 - test_sas - INFO - TEST: test_02_get_token_with_custom_duration -2026-04-21 10:39:37,011 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:37,011 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,011 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:37,011 - test_sas - INFO - Input - duration_in_minutes: 60 -2026-04-21 10:39:37,011 - test_sas - INFO - Calling: get_token(collection_id=naip, duration_in_minutes=60) -2026-04-21 10:39:37,016 - test_sas - INFO - Response type: -2026-04-21 10:39:37,017 - test_sas - INFO - Response: {'msft:expiry': '2026-04-21T10:33:33Z', 'token': 'Sanitized'} -2026-04-21 10:39:37,017 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-21T10:33:33Z', 'token': 'Sanitized'} -2026-04-21 10:39:37,017 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:37,026 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:37,027 - test_sas - INFO - TEST: test_03_get_sign_with_collection_thumbnail -2026-04-21 10:39:37,027 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:37,027 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,027 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:37,027 - test_sas - INFO - Getting collection... -2026-04-21 10:39:37,036 - test_sas - INFO - Original HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png -2026-04-21 10:39:37,037 - test_sas - INFO - Calling: get_sign(href=https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) -2026-04-21 10:39:37,040 - test_sas - INFO - Response type: -2026-04-21 10:39:37,040 - test_sas - INFO - Response: {'msft:expiry': '2026-04-22T09:33:34Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A30Z&ske=2026-04-28T09%3A32%3A30Z&sks=b&skv=2025-01-05&sig=Sanitized'} -2026-04-21 10:39:37,040 - test_sas - INFO - Response as_dict: {'msft:expiry': '2026-04-22T09:33:34Z', 'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A30Z&ske=2026-04-28T09%3A32%3A30Z&sks=b&skv=2025-01-05&sig=Sanitized'} -2026-04-21 10:39:37,040 - test_sas - INFO - Signed HREF: https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=Sanitized&se=Sanitized&sp=rl&sv=Sanitized&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T09%3A33%3A30Z&ske=2026-04-28T09%3A32%3A30Z&sks=b&skv=2025-01-05&sig=Sanitized -2026-04-21 10:39:37,040 - test_sas - INFO - HREF changed: True -2026-04-21 10:39:37,040 - test_sas - INFO - Has query params: True -2026-04-21 10:39:37,040 - test_sas - INFO - Has sig param: True -2026-04-21 10:39:37,040 - test_sas - INFO - Test PASSED - -2026-04-21 10:39:37,053 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:37,053 - test_sas - INFO - TEST: test_05_revoke_token -2026-04-21 10:39:37,053 - test_sas - INFO - ================================================================================ -2026-04-21 10:39:37,054 - test_sas - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,054 - test_sas - INFO - Input - collection_id: naip -2026-04-21 10:39:37,054 - test_sas - INFO - Step 1: Generating SAS token... -2026-04-21 10:39:37,063 - test_sas - INFO - Token generated: Sanitized... -2026-04-21 10:39:37,063 - test_sas - INFO - Step 2: Revoking token... -2026-04-21 10:39:37,066 - test_sas - INFO - Token revoked successfully (no exception thrown) -2026-04-21 10:39:37,066 - test_sas - INFO - Test PASSED +2026-04-21 11:33:53,751 - test_sas - INFO - ================================================================================ +2026-04-21 11:33:53,752 - test_sas - INFO - TEST: test_04_signed_href_can_download_asset +2026-04-21 11:33:53,752 - test_sas - INFO - ================================================================================ +2026-04-21 11:33:53,752 - test_sas - INFO - Input - endpoint: https://stablecat.gjehh4bsh5hdeegx.uksouth.geocatalog.ppe.spatio.azure-test.net +2026-04-21 11:33:53,752 - test_sas - INFO - Input - collection_id: naip +2026-04-21 11:33:53,974 - test_sas - INFO - Getting collection... +2026-04-21 11:33:56,335 - test_sas - INFO - Thumbnail HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png +2026-04-21 11:33:56,336 - test_sas - INFO - Calling: get_sign(href=https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) +2026-04-21 11:33:57,020 - test_sas - INFO - Signed HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=2026-04-20T10%3A33%3A56Z&se=2026-04-22T10%3A33%3A56Z&sp=rl&sv=2025-01-05&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T10%3A33%3A55Z&ske=2026-04-28T10%3A32%3A55Z&sks=b&skv=2025-01-05&sig=xgkaBVMGztmjZejIj9g%2BEW%2B/G4XMiU/mu9W0W42Gyc0%3D +2026-04-21 11:33:57,020 - test_sas - INFO - Attempting to download asset (live mode)... +2026-04-21 11:33:57,528 - test_sas - INFO - Download status code: 200 +2026-04-21 11:33:57,528 - test_sas - INFO - Content length: 75 bytes +2026-04-21 11:33:57,528 - test_sas - INFO - Content-Type: application/octet-stream +2026-04-21 11:33:57,529 - test_sas - INFO - Test PASSED + +2026-04-21 11:33:57,827 - test_sas - INFO - ================================================================================ +2026-04-21 11:33:57,827 - test_sas - INFO - TEST: test_04_signed_href_can_download_asset +2026-04-21 11:33:57,827 - test_sas - INFO - ================================================================================ +2026-04-21 11:33:57,827 - test_sas - INFO - Input - endpoint: https://stablecat.gjehh4bsh5hdeegx.uksouth.geocatalog.ppe.spatio.azure-test.net +2026-04-21 11:33:57,828 - test_sas - INFO - Input - collection_id: naip +2026-04-21 11:33:57,942 - test_sas - INFO - Getting collection... +2026-04-21 11:33:58,946 - test_sas - INFO - Thumbnail HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png +2026-04-21 11:33:58,947 - test_sas - INFO - Calling: get_sign(href=https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) +2026-04-21 11:33:59,025 - test_sas - INFO - Signed HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=2026-04-20T10%3A33%3A59Z&se=2026-04-22T10%3A33%3A59Z&sp=rl&sv=2025-01-05&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T10%3A33%3A55Z&ske=2026-04-28T10%3A32%3A55Z&sks=b&skv=2025-01-05&sig=mbULY6xuCrb2Fl%2B/u5wHGJPnAcJCBgCfZYAw%2BW1IdXg%3D +2026-04-21 11:33:59,025 - test_sas - INFO - Attempting to download asset (live mode)... +2026-04-21 11:33:59,391 - test_sas - INFO - Download status code: 200 +2026-04-21 11:33:59,391 - test_sas - INFO - Content length: 75 bytes +2026-04-21 11:33:59,391 - test_sas - INFO - Content-Type: application/octet-stream +2026-04-21 11:33:59,391 - test_sas - INFO - Test PASSED diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log index c871e18c8378..245e606b955f 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log @@ -1,241 +1,9 @@ -2026-04-21 10:39:36,114 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,114 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Get STAC API Conformance Classes -2026-04-21 10:39:36,115 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved 15 conformance classes -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 1: http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2 -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 2: http://www.opengis.net/spec/cql2/1.0/conf/cql2-json -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 3: http://www.opengis.net/spec/cql2/1.0/conf/cql2-text -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 4: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 5: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 6: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30 -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 7: http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 8: https://api.stacspec.org/v1.0.0-rc.2/item-search#filter -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 9: https://api.stacspec.org/v1.0.0/collections -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 10: https://api.stacspec.org/v1.0.0/core -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 11: https://api.stacspec.org/v1.0.0/item-search -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 12: https://api.stacspec.org/v1.0.0/item-search#fields -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 13: https://api.stacspec.org/v1.0.0/item-search#query -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 14: https://api.stacspec.org/v1.0.0/item-search#sort -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Conformance 15: https://api.stacspec.org/v1.0.0/ogcapi-features -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: https://api.stacspec.org/v1.0.0/core -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: https://api.stacspec.org/v1.0.0/collections -2026-04-21 10:39:36,121 - test_planetary_computer_02_stac_specification_async - INFO - Supports: https://api.stacspec.org/v1.0.0/item-search -2026-04-21 10:39:36,138 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,138 - test_planetary_computer_02_stac_specification_async - INFO - TEST: List STAC Collections -2026-04-21 10:39:36,138 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved 7 collections -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - -Collection 1: -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - ID: sentinel-2 -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Title: Sentinel-2 Test -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Description: Sentinel-2 placeholder for testing -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - -Collection 2: -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - ID: landsat-8 -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Title: Landsat-8 Test -2026-04-21 10:39:36,165 - test_planetary_computer_02_stac_specification_async - INFO - Description: Landsat-8 placeholder for testing -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - -Collection 3: -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - ID: dem -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Title: DEM Test -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Description: Digital Elevation Model placeholder for testing -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - -Collection 4: -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - ID: land-cover -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Title: Land Cover Test -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Description: Land cover placeholder for testing -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - -Collection 5: -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - ID: io-collection -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Title: Impact Observatory Collection -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - Description: An example collection -2026-04-21 10:39:36,166 - test_planetary_computer_02_stac_specification_async - INFO - License: CC-BY-4.0 -2026-04-21 10:39:36,183 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,183 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Get STAC Collection (naip) -2026-04-21 10:39:36,183 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved collection: naip -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Title: NAIP Test Dataset -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Description: NAIP imagery for SDK testing... -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - License: proprietary -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Extent: -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Spatial attributes: ['as_dict', 'bounding_box', 'clear', 'copy', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Temporal interval: [[datetime.datetime(2020, 1, 1, 0, 0, tzinfo=), datetime.datetime(2099, 12, 31, 23, 59, 59, tzinfo=)]] -2026-04-21 10:39:36,193 - test_planetary_computer_02_stac_specification_async - INFO - Links count: 5 -2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - items: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items -2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - parent: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/ -2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - root: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/ -2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - self: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip -2026-04-21 10:39:36,194 - test_planetary_computer_02_stac_specification_async - INFO - - http://www.opengis.net/def/rel/ogc/1.0/queryables: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/queryables -2026-04-21 10:39:36,212 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,212 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Search STAC Items with Spatial Filter -2026-04-21 10:39:36,212 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Search returned 5 items -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - -Item 1: -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_nw_16_060_20211114 -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Geometry type: Polygon -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - -Item 2: -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_ne_16_060_20211114 -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Geometry type: Polygon -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - -Item 3: -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308421_sw_16_060_20211114 -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,257 - test_planetary_computer_02_stac_specification_async - INFO - Geometry type: Polygon -2026-04-21 10:39:36,279 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,279 - test_planetary_computer_02_stac_specification_async - INFO - TEST: List Items in Collection -2026-04-21 10:39:36,279 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved 10 items from collection naip -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - -Item 1: -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_sw_16_060_20211114 -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - -Item 2: -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_se_16_060_20211114 -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - -Item 3: -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_nw_16_060_20211114 -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - -Item 4: -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308429_ne_16_060_20211114 -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,357 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - -Item 5: -2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - ID: ga_m_3308422_sw_16_060_20211114 -2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,358 - test_planetary_computer_02_stac_specification_async - INFO - Assets: image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,371 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,372 - test_planetary_computer_02_stac_specification_async - INFO - TEST: List Collection Queryables -2026-04-21 10:39:36,372 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved queryables for collection: naip -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Found 4 queryable properties -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 1: id -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item identifier -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 2: datetime -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Datetime -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Type: string -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 3: geometry -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item Geometry -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://geojson.org/schema/Feature.json -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 4: test:property -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Test property - updated -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 1: id -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item identifier -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 2: datetime -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Datetime -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Type: string -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 3: geometry -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item Geometry -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://geojson.org/schema/Feature.json -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 4: test:property -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Test property - updated -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 1: id -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item identifier -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 2: datetime -2026-04-21 10:39:36,379 - test_planetary_computer_02_stac_specification_async - INFO - Description: Datetime -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Type: string -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 3: geometry -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Description: Item Geometry -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Reference: https://geojson.org/schema/Feature.json -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - -Queryable 4: test:property -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Description: Test property - updated -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - -Queryables schema: http://json-schema.org/draft-07/schema# -2026-04-21 10:39:36,380 - test_planetary_computer_02_stac_specification_async - INFO - Queryables ID: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/queryables?api-version=2026-04-15 -2026-04-21 10:39:36,395 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,395 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Search Items with Temporal Filter -2026-04-21 10:39:36,395 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Temporal search returned 10 items -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - -Item 1: ga_m_3308429_sw_16_060_20211114 -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Datetime: 2021-11-14T16:00:00Z -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - -Item 2: ga_m_3308429_se_16_060_20211114 -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Datetime: 2021-11-14T16:00:00Z -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - -Item 3: ga_m_3308429_nw_16_060_20211114 -2026-04-21 10:39:36,473 - test_planetary_computer_02_stac_specification_async - INFO - Datetime: 2021-11-14T16:00:00Z -2026-04-21 10:39:36,496 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,496 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Search Items with Sorting -2026-04-21 10:39:36,496 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Search with DESC sorting returned 5 items -2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 1: ga_m_3308429_sw_16_060_20211114 -2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 2: ga_m_3308429_se_16_060_20211114 -2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 3: ga_m_3308429_nw_16_060_20211114 -2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 4: ga_m_3308429_ne_16_060_20211114 -2026-04-21 10:39:36,576 - test_planetary_computer_02_stac_specification_async - INFO - Item 5: ga_m_3308422_sw_16_060_20211114 -2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - -Search with ASC sorting returned 5 items -2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 1: ga_m_3308429_sw_16_060_20211114 -2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 2: ga_m_3308429_se_16_060_20211114 -2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 3: ga_m_3308429_nw_16_060_20211114 -2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 4: ga_m_3308429_ne_16_060_20211114 -2026-04-21 10:39:36,583 - test_planetary_computer_02_stac_specification_async - INFO - Item 5: ga_m_3308422_sw_16_060_20211114 -2026-04-21 10:39:36,604 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,604 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Create STAC Item -2026-04-21 10:39:36,604 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,605 - test_planetary_computer_02_stac_specification_async - INFO - Creating STAC item: ga_m_3308421_se_16_060_20211114_test -2026-04-21 10:39:36,701 - test_planetary_computer_02_stac_specification_async - INFO - Item ga_m_3308421_se_16_060_20211114_test already exists. Deleting it first... -2026-04-21 10:39:36,709 - test_planetary_computer_02_stac_specification_async - INFO - Deleted existing item ga_m_3308421_se_16_060_20211114_test -2026-04-21 10:39:36,737 - test_planetary_computer_02_stac_specification_async - INFO - Successfully created item ga_m_3308421_se_16_060_20211114_test -2026-04-21 10:39:36,737 - test_planetary_computer_02_stac_specification_async - INFO - Create operation result: None -2026-04-21 10:39:36,740 - test_planetary_computer_02_stac_specification_async - INFO - Verified item creation: ga_m_3308421_se_16_060_20211114_test -2026-04-21 10:39:36,740 - test_planetary_computer_02_stac_specification_async - INFO - Created item has 1 assets -2026-04-21 10:39:36,758 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,758 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Update STAC Item -2026-04-21 10:39:36,758 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,775 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved item for update: ga_m_3308421_se_16_060_20211114_test -2026-04-21 10:39:36,776 - test_planetary_computer_02_stac_specification_async - INFO - Updating item with platform property: Imagery -2026-04-21 10:39:36,787 - test_planetary_computer_02_stac_specification_async - ERROR - Failed to update item: Operation returned an invalid status 'OK' -Content: {"id": "00000000-0000-0000-0000-000000000000","status":"Failed","statusHistory":[{"status":"Pending","timestamp":"2026-04-21T09:31:44.098937Z"},{"status":"Running","timestamp":"2026-04-21T09:31:44.389506Z"},{"status":"Failed","timestamp":"2026-04-21T09:31:49.991125Z","errorCode":"IngestionResourceForbidden","errorMessage":"Asset transformation exception. Reason: Error retrieving content from sas token source. Reason: Forbidden access. You do not have permission to access this resource. Verify your access control settings, role assignments, SAS Token or that the managed identity has the required permissions. Learn more about access control: https://aka.ms/mpcpro-ingestion-source. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif"}],"type":"UpdateItem","creationTime":"2026-04-21T09:31:44.098937Z","startTime":"2026-04-21T09:31:44.098937Z","finishTime":"2026-04-21T09:31:49.991125Z","collectionId":"naip","additionalInformation":{"TotalFailedItems":"1","TotalItems":"1","TotalPendingItems":"0","TotalSuccessfulItems":"0"},"error":{"error":{"code":"IngestionResourceForbidden","message":"Asset transformation exception. Reason: Error retrieving content from sas token source. Reason: Forbidden access. You do not have permission to access this resource. Verify your access control settings, role assignments, SAS Token or that the managed identity has the required permissions. Learn more about access control: https://aka.ms/mpcpro-ingestion-source. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif. Source: https://SANITIZED.blob.core.windows.net/naip-bf48131e/08a/ga_m_3308421_se_16_060_20211114_test/image.tif"}}} -2026-04-21 10:39:36,787 - test_planetary_computer_02_stac_specification_async - INFO - Item update may not be supported in this environment or item doesn't exist -2026-04-21 10:39:36,788 - test_planetary_computer_02_stac_specification_async - INFO - This is expected if public access is restricted on the storage account -2026-04-21 10:39:36,803 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,803 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Get STAC Item -2026-04-21 10:39:36,803 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,822 - test_planetary_computer_02_stac_specification_async - INFO - Getting item: ga_m_3308429_sw_16_060_20211114 -2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Retrieved item: ga_m_3308429_sw_16_060_20211114 -2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Collection: naip -2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Assets (4): image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,827 - test_planetary_computer_02_stac_specification_async - INFO - Found common assets: image, tilejson, thumbnail, rendered_preview -2026-04-21 10:39:36,838 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,838 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Delete STAC Item -2026-04-21 10:39:36,839 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 10:39:36,839 - test_planetary_computer_02_stac_specification_async - INFO - Creating STAC item to delete: ga_m_3308421_se_16_060_20211114_delete_test -2026-04-21 10:39:36,873 - test_planetary_computer_02_stac_specification_async - INFO - Created item ga_m_3308421_se_16_060_20211114_delete_test -2026-04-21 10:39:36,876 - test_planetary_computer_02_stac_specification_async - INFO - Verified item ga_m_3308421_se_16_060_20211114_delete_test exists -2026-04-21 10:39:36,876 - test_planetary_computer_02_stac_specification_async - INFO - Deleting item ga_m_3308421_se_16_060_20211114_delete_test... -2026-04-21 10:39:36,883 - test_planetary_computer_02_stac_specification_async - INFO - Delete operation completed for item ga_m_3308421_se_16_060_20211114_delete_test -2026-04-21 10:39:36,883 - test_planetary_computer_02_stac_specification_async - INFO - Verifying item ga_m_3308421_se_16_060_20211114_delete_test was deleted... -2026-04-21 10:39:36,886 - test_planetary_computer_02_stac_specification_async - INFO - Verified item ga_m_3308421_se_16_060_20211114_delete_test was successfully deleted -2026-04-21 10:39:36,886 - test_planetary_computer_02_stac_specification_async - INFO - Successfully completed delete test for item ga_m_3308421_se_16_060_20211114_delete_test +2026-04-21 20:08:53,785 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 20:08:53,785 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Replace STAC Item +2026-04-21 20:08:53,786 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ +2026-04-21 20:08:55,560 - test_planetary_computer_02_stac_specification_async - INFO - Using test item for replace test: ga_m_3308421_se_16_060_20211114_test +2026-04-21 20:08:55,560 - test_planetary_computer_02_stac_specification_async - INFO - Replacing item ga_m_3308421_se_16_060_20211114_test using begin_replace_item... +2026-04-21 20:09:26,039 - test_planetary_computer_02_stac_specification_async - INFO - Replaced item ga_m_3308421_se_16_060_20211114_test +2026-04-21 20:09:26,108 - test_planetary_computer_02_stac_specification_async - INFO - Verified replaced item, platform: Imagery Updated via Replace Test +2026-04-21 20:09:26,924 - test_planetary_computer_02_stac_specification_async - INFO - Restored original item ga_m_3308421_se_16_060_20211114_test +2026-04-21 20:09:26,924 - test_planetary_computer_02_stac_specification_async - INFO - Successfully verified replace operation for item ga_m_3308421_se_16_060_20211114_test diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py index 5b3975b776f5..0da04fde6043 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification.py @@ -693,14 +693,14 @@ def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_collect else: logger.warning("No items found in collection to test get_item") - @pytest.mark.skip(reason="Service re-processes all assets during replace; derived assets not found in managed storage") @PlanetaryComputerPreparer() @recorded_by_proxy def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test replacing an existing STAC item. - This demonstrates using begin_replace_item to update an existing item's properties. - The item must already exist in the collection. + After creation, the service copies assets into managed storage and rewrites hrefs. + For replace to work, we must rewrite asset hrefs back to the original public source + URLs, since the service re-ingests all assets during replace. """ logger.info("=" * 80) logger.info("TEST: Replace STAC Item") @@ -708,24 +708,32 @@ def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetarycompute client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id + item_id = "ga_m_3308421_se_16_060_20211114_test" - # Get an existing item from the collection to replace - items_response = client.stac.get_item_collection(collection_id=collection_id, limit=1) - assert len(items_response.features) > 0, "Collection must have at least one item to test replace" - - existing_item = items_response.features[0] - item_id = existing_item.id - logger.info(f"Using existing item for replace test: {item_id}") + # Original public source URL used when the item was created in test_10 + original_image_href = "https://naipeuwest.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif" # Get the full item stac_item = client.stac.get_item(collection_id=collection_id, item_id=item_id) assert stac_item is not None, "Item should be retrievable" + logger.info(f"Using test item for replace test: {item_id}") - # Modify a property + # Build the replacement item dict stac_item_dict = stac_item.as_dict() if hasattr(stac_item, "as_dict") else dict(stac_item) original_platform = stac_item_dict.get("properties", {}).get("platform", None) stac_item_dict["properties"]["platform"] = "Imagery Updated via Replace Test" + # Rewrite asset hrefs back to original public source URLs + # The service re-ingests assets during replace, so hrefs must be accessible + stac_item_dict["assets"] = { + "image": { + "href": original_image_href, + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": ["data"], + "title": "RGBIR COG tile", + } + } + updated_stac_item = StacItem(stac_item_dict) # Replace the item @@ -746,7 +754,7 @@ def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetarycompute logger.info(f"Verified replaced item, platform: {platform}") assert platform == "Imagery Updated via Replace Test", f"Expected updated platform, got '{platform}'" - # Restore original value + # Restore original value (also with original hrefs) if original_platform is not None: stac_item_dict["properties"]["platform"] = original_platform else: diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py index 5e7711ca7bbd..ea183a7500ff 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_02_stac_specification_async.py @@ -719,14 +719,14 @@ async def test_12_get_item(self, planetarycomputer_endpoint, planetarycomputer_c await self.close_client() - @pytest.mark.skip(reason="Service re-processes all assets during replace; derived assets not found in managed storage") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetarycomputer_collection_id): """Test replacing an existing STAC item. - This demonstrates using begin_replace_item to update an existing item's properties. - The item must already exist in the collection. + After creation, the service copies assets into managed storage and rewrites hrefs. + For replace to work, we must rewrite asset hrefs back to the original public source + URLs, since the service re-ingests all assets during replace. """ logger.info("=" * 80) logger.info("TEST: Replace STAC Item") @@ -734,24 +734,32 @@ async def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetaryc client = self.create_client(endpoint=planetarycomputer_endpoint) collection_id = planetarycomputer_collection_id + item_id = "ga_m_3308421_se_16_060_20211114_test" - # Get an existing item from the collection to replace - items_response = await client.stac.get_item_collection(collection_id=collection_id, limit=1) - assert len(items_response.features) > 0, "Collection must have at least one item to test replace" - - existing_item = items_response.features[0] - item_id = existing_item.id - logger.info(f"Using existing item for replace test: {item_id}") + # Original public source URL used when the item was created in test_10 + original_image_href = "https://naipeuwest.blob.core.windows.net/naip/v002/ga/2021/ga_060cm_2021/33084/m_3308421_se_16_060_20211114.tif" # Get the full item stac_item = await client.stac.get_item(collection_id=collection_id, item_id=item_id) assert stac_item is not None, "Item should be retrievable" + logger.info(f"Using test item for replace test: {item_id}") - # Modify a property + # Build the replacement item dict stac_item_dict = stac_item.as_dict() if hasattr(stac_item, "as_dict") else dict(stac_item) original_platform = stac_item_dict.get("properties", {}).get("platform", None) stac_item_dict["properties"]["platform"] = "Imagery Updated via Replace Test" + # Rewrite asset hrefs back to original public source URLs + # The service re-ingests assets during replace, so hrefs must be accessible + stac_item_dict["assets"] = { + "image": { + "href": original_image_href, + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": ["data"], + "title": "RGBIR COG tile", + } + } + updated_stac_item = StacItem(stac_item_dict) # Replace the item @@ -772,7 +780,7 @@ async def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetaryc logger.info(f"Verified replaced item, platform: {platform}") assert platform == "Imagery Updated via Replace Test", f"Expected updated platform, got '{platform}'" - # Restore original value + # Restore original value (also with original hrefs) if original_platform is not None: stac_item_dict["properties"]["platform"] = original_platform else: @@ -781,7 +789,7 @@ async def test_13_replace_stac_item(self, planetarycomputer_endpoint, planetaryc restore_poller = await client.stac.begin_replace_item( collection_id=collection_id, item_id=item_id, body=restore_item, polling=True ) - await restore_poller.result() + await replace_poller.result() logger.info(f"Restored original item {item_id}") logger.info(f"Successfully verified replace operation for item {item_id}") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py index d27ed6531c09..fcdd3b562e0e 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py @@ -218,7 +218,6 @@ def test_03_get_sign_with_collection_thumbnail(self, planetarycomputer_endpoint, test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE managed storage SAS token authentication fails with 403") @PlanetaryComputerPreparer() @recorded_by_proxy def test_04_signed_href_can_download_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py index 717aa3c948aa..c087a97b1ca1 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py @@ -230,7 +230,6 @@ async def test_03_get_sign_with_collection_thumbnail( await self.close_client() - @pytest.mark.skip(reason="PPE managed storage SAS token authentication fails with 403") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_04_signed_href_can_download_asset(self, planetarycomputer_endpoint, planetarycomputer_collection_id): From 5004bd03dca3e90641f196f79ab6943bb90b5dd6 Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Wed, 22 Apr 2026 08:32:54 +0100 Subject: [PATCH 4/9] Remove sas_test_results.log --- .../tests/logs/sas_test_results.log | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log deleted file mode 100644 index 752dc8148d6d..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/sas_test_results.log +++ /dev/null @@ -1,30 +0,0 @@ -2026-04-21 11:33:53,751 - test_sas - INFO - ================================================================================ -2026-04-21 11:33:53,752 - test_sas - INFO - TEST: test_04_signed_href_can_download_asset -2026-04-21 11:33:53,752 - test_sas - INFO - ================================================================================ -2026-04-21 11:33:53,752 - test_sas - INFO - Input - endpoint: https://stablecat.gjehh4bsh5hdeegx.uksouth.geocatalog.ppe.spatio.azure-test.net -2026-04-21 11:33:53,752 - test_sas - INFO - Input - collection_id: naip -2026-04-21 11:33:53,974 - test_sas - INFO - Getting collection... -2026-04-21 11:33:56,335 - test_sas - INFO - Thumbnail HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png -2026-04-21 11:33:56,336 - test_sas - INFO - Calling: get_sign(href=https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) -2026-04-21 11:33:57,020 - test_sas - INFO - Signed HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=2026-04-20T10%3A33%3A56Z&se=2026-04-22T10%3A33%3A56Z&sp=rl&sv=2025-01-05&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T10%3A33%3A55Z&ske=2026-04-28T10%3A32%3A55Z&sks=b&skv=2025-01-05&sig=xgkaBVMGztmjZejIj9g%2BEW%2B/G4XMiU/mu9W0W42Gyc0%3D -2026-04-21 11:33:57,020 - test_sas - INFO - Attempting to download asset (live mode)... -2026-04-21 11:33:57,528 - test_sas - INFO - Download status code: 200 -2026-04-21 11:33:57,528 - test_sas - INFO - Content length: 75 bytes -2026-04-21 11:33:57,528 - test_sas - INFO - Content-Type: application/octet-stream -2026-04-21 11:33:57,529 - test_sas - INFO - Test PASSED - -2026-04-21 11:33:57,827 - test_sas - INFO - ================================================================================ -2026-04-21 11:33:57,827 - test_sas - INFO - TEST: test_04_signed_href_can_download_asset -2026-04-21 11:33:57,827 - test_sas - INFO - ================================================================================ -2026-04-21 11:33:57,827 - test_sas - INFO - Input - endpoint: https://stablecat.gjehh4bsh5hdeegx.uksouth.geocatalog.ppe.spatio.azure-test.net -2026-04-21 11:33:57,828 - test_sas - INFO - Input - collection_id: naip -2026-04-21 11:33:57,942 - test_sas - INFO - Getting collection... -2026-04-21 11:33:58,946 - test_sas - INFO - Thumbnail HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png -2026-04-21 11:33:58,947 - test_sas - INFO - Calling: get_sign(href=https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png) -2026-04-21 11:33:59,025 - test_sas - INFO - Signed HREF: https://jihuztdatasa.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png?st=2026-04-20T10%3A33%3A59Z&se=2026-04-22T10%3A33%3A59Z&sp=rl&sv=2025-01-05&sr=c&skoid=fff67d55-f141-45bc-9972-65e021a426ad&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-04-21T10%3A33%3A55Z&ske=2026-04-28T10%3A32%3A55Z&sks=b&skv=2025-01-05&sig=mbULY6xuCrb2Fl%2B/u5wHGJPnAcJCBgCfZYAw%2BW1IdXg%3D -2026-04-21 11:33:59,025 - test_sas - INFO - Attempting to download asset (live mode)... -2026-04-21 11:33:59,391 - test_sas - INFO - Download status code: 200 -2026-04-21 11:33:59,391 - test_sas - INFO - Content length: 75 bytes -2026-04-21 11:33:59,391 - test_sas - INFO - Content-Type: application/octet-stream -2026-04-21 11:33:59,391 - test_sas - INFO - Test PASSED - From 375dade7d3af50a6836f8c0cc931f6d5966a5856 Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Wed, 22 Apr 2026 14:00:12 +0100 Subject: [PATCH 5/9] Enable _05 and _08 tiler tests, add cspell words, remove tracked log files --- .vscode/cspell.json | 4 + .../collection_lifecycle_test_results.log | 107 -- .../collection_tiler_async_test_results.log | 9 - .../logs/collection_tiler_test_results.log | 9 - .../tests/logs/ingestion_test_results.log | 1043 ----------------- .../tests/logs/map_legends_test_results.log | 120 -- .../tests/logs/mosaics_tiler_test_results.log | 8 - .../logs/stac_collection_test_results.log | 523 --------- .../logs/stac_item_tiler_test_results.log | 382 ------ .../logs/stac_specification_test_results.log | 9 - ...est_planetary_computer_05_mosaics_tiler.py | 9 +- ...anetary_computer_05_mosaics_tiler_async.py | 9 +- ..._planetary_computer_08_collection_tiler.py | 10 +- ...tary_computer_08_collection_tiler_async.py | 10 +- 14 files changed, 12 insertions(+), 2240 deletions(-) delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log delete mode 100644 sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 0a3313eff763..630a77d26816 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -2194,6 +2194,10 @@ { "filename": ".github/**/ml/**", "words": ["envml", "paginators"] + }, + { + "filename": "sdk/planetarycomputer/azure-planetarycomputer/**", + "words": ["topo", "haline", "Aproperty"] } ], "allowCompoundWords": true diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log deleted file mode 100644 index b5358794b552..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_lifecycle_test_results.log +++ /dev/null @@ -1,107 +0,0 @@ -2026-04-21 10:39:39,085 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,085 - test_collection_lifecycle - INFO - TEST: test_01_begin_create_collection -2026-04-21 10:39:39,085 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,098 - test_collection_lifecycle - INFO - Collection 'test-collection-lifecycle' does not exist, proceeding with creation -2026-04-21 10:39:39,100 - test_collection_lifecycle - INFO - Calling: begin_create_collection(body=collection_data) -2026-04-21 10:39:39,118 - test_collection_lifecycle - INFO - Collection created: None -2026-04-21 10:39:39,124 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:39:39,134 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,134 - test_collection_lifecycle - INFO - TEST: test_02_replace_collection -2026-04-21 10:39:39,134 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,148 - test_collection_lifecycle - INFO - Calling: replace_collection(collection_id='test-collection-lifecycle', body=collection) -2026-04-21 10:39:39,154 - test_collection_lifecycle - INFO - Collection updated: {'id': 'test-collection-lifecycle', 'type': 'Collection', 'links': [{'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'items', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/items'}], 'title': 'Test Collection Lifecycle', 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2024-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'description': 'Test collection for lifecycle operations - UPDATED', 'stac_version': '1.0.0', 'msft:_created': '2026-04-21T09:35:40.375857Z', 'msft:_updated': '2026-04-21T09:35:57.4682417Z'} -2026-04-21 10:39:39,157 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:39:39,166 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,166 - test_collection_lifecycle - INFO - TEST: test_03_begin_delete_collection -2026-04-21 10:39:39,166 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,167 - test_collection_lifecycle - INFO - Calling: begin_delete_collection(collection_id='test-collection-lifecycle') -2026-04-21 10:39:39,180 - test_collection_lifecycle - INFO - Delete operation completed: None -2026-04-21 10:39:39,182 - test_collection_lifecycle - INFO - Collection successfully deleted (404 expected): (ResourceNotFound) Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. -Code: ResourceNotFound -Message: Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. -2026-04-21 10:39:39,182 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:39:39,194 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,194 - test_collection_lifecycle - INFO - TEST: test_04_create_collection_asset -2026-04-21 10:39:39,195 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,195 - test_collection_lifecycle - INFO - Checking if asset 'test-asset' already exists and deleting if found... -2026-04-21 10:39:39,208 - test_collection_lifecycle - INFO - Deleted existing 'test-asset' -2026-04-21 10:39:39,208 - test_collection_lifecycle - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) -2026-04-21 10:39:39,213 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:36:31.016110Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset', 'roles': ['metadata']}}} -2026-04-21 10:39:39,213 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - TEST: test_05_replace_collection_asset -2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,221 - test_collection_lifecycle - INFO - Calling: replace_collection_asset(collection_id='naip', asset_id='test-asset', body={...}) -2026-04-21 10:39:39,232 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:36:32.443371Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}}} -2026-04-21 10:39:39,232 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - TEST: test_06_delete_collection_asset -2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,242 - test_collection_lifecycle - INFO - Creating asset for deletion: test-asset-to-be-deleted -2026-04-21 10:39:39,258 - test_collection_lifecycle - INFO - Asset created successfully -2026-04-21 10:39:39,258 - test_collection_lifecycle - INFO - Calling: delete_collection_asset(collection_id='naip', asset_id='test-asset-to-be-deleted') -2026-04-21 10:39:39,261 - test_collection_lifecycle - INFO - Asset deleted successfully -2026-04-21 10:39:39,264 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:39:39,289 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,289 - test_collection_lifecycle - INFO - TEST: test_01_begin_create_collection -2026-04-21 10:39:39,289 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:39:39,314 - test_collection_lifecycle - INFO - Collection 'test-collection-lifecycle' does not exist, proceeding with creation -2026-04-21 10:39:39,315 - test_collection_lifecycle - INFO - Calling: begin_create_collection(body=collection_data) -2026-04-21 10:39:39,319 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 1/12) -2026-04-21 10:39:44,346 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 2/12) -2026-04-21 10:39:49,363 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 3/12) -2026-04-21 10:39:54,380 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 4/12) -2026-04-21 10:39:59,396 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 5/12) -2026-04-21 10:40:04,410 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 6/12) -2026-04-21 10:40:09,428 - test_collection_lifecycle - INFO - Collection still being deleted, retrying in 5s (attempt 7/12) -2026-04-21 10:40:14,440 - test_collection_lifecycle - INFO - Collection created: None -2026-04-21 10:40:14,443 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:40:14,459 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,459 - test_collection_lifecycle - INFO - TEST: test_02_replace_collection -2026-04-21 10:40:14,459 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,478 - test_collection_lifecycle - INFO - Calling: replace_collection(collection_id='test-collection-lifecycle', body=collection) -2026-04-21 10:40:14,493 - test_collection_lifecycle - INFO - Collection updated: {'id': 'test-collection-lifecycle', 'type': 'Collection', 'links': [{'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/'}, {'rel': 'items', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/test-collection-lifecycle/items'}], 'title': 'Test Collection Lifecycle', 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2024-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'description': 'Test collection for lifecycle operations - UPDATED', 'stac_version': '1.0.0', 'msft:_created': '2026-04-21T09:37:40.8393036Z', 'msft:_updated': '2026-04-21T09:37:45.0062545Z'} -2026-04-21 10:40:14,499 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - TEST: test_03_begin_delete_collection -2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,569 - test_collection_lifecycle - INFO - Calling: begin_delete_collection(collection_id='test-collection-lifecycle') -2026-04-21 10:40:14,585 - test_collection_lifecycle - INFO - Delete operation completed: None -2026-04-21 10:40:14,589 - test_collection_lifecycle - INFO - Collection successfully deleted (404 expected): (ResourceNotFound) Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. -Code: ResourceNotFound -Message: Collection 'test-collection-lifecycle' not found. Please verify the collection ID and try again. -2026-04-21 10:40:14,589 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:40:14,599 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,599 - test_collection_lifecycle - INFO - TEST: test_04_create_collection_asset -2026-04-21 10:40:14,599 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,600 - test_collection_lifecycle - INFO - Checking if asset 'test-asset' already exists and deleting if found... -2026-04-21 10:40:14,625 - test_collection_lifecycle - INFO - Deleted existing 'test-asset' -2026-04-21 10:40:14,625 - test_collection_lifecycle - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) -2026-04-21 10:40:14,635 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:38:20.607442Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset', 'roles': ['metadata']}}} -2026-04-21 10:40:14,635 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - TEST: test_05_replace_collection_asset -2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,648 - test_collection_lifecycle - INFO - Calling: replace_collection_asset(collection_id='naip', asset_id='test-asset', body={...}) -2026-04-21 10:40:14,661 - test_collection_lifecycle - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:38:22.215021Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}, 'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}}} -2026-04-21 10:40:14,661 - test_collection_lifecycle - INFO - Test PASSED - -2026-04-21 10:40:14,674 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,674 - test_collection_lifecycle - INFO - TEST: test_06_delete_collection_asset -2026-04-21 10:40:14,674 - test_collection_lifecycle - INFO - ================================================================================ -2026-04-21 10:40:14,675 - test_collection_lifecycle - INFO - Creating asset for deletion: test-asset-to-be-deleted -2026-04-21 10:40:14,696 - test_collection_lifecycle - INFO - Asset created successfully -2026-04-21 10:40:14,696 - test_collection_lifecycle - INFO - Calling: delete_collection_asset(collection_id='naip', asset_id='test-asset-to-be-deleted') -2026-04-21 10:40:14,699 - test_collection_lifecycle - INFO - Asset deleted successfully -2026-04-21 10:40:14,702 - test_collection_lifecycle - INFO - Test PASSED - diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log deleted file mode 100644 index 631ab8f86449..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_async_test_results.log +++ /dev/null @@ -1,9 +0,0 @@ -2026-04-21 11:43:42,015 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 11:43:42,016 - test_collection_tiler - INFO - TEST: test_02_get_collection_point -2026-04-21 11:43:42,016 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 11:43:45,754 - test_collection_tiler - INFO - Response type: -2026-04-21 11:43:45,755 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 11:43:46,028 - test_collection_tiler - INFO - TEST: test_02_get_collection_point -2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log deleted file mode 100644 index 631ab8f86449..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/collection_tiler_test_results.log +++ /dev/null @@ -1,9 +0,0 @@ -2026-04-21 11:43:42,015 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 11:43:42,016 - test_collection_tiler - INFO - TEST: test_02_get_collection_point -2026-04-21 11:43:42,016 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 11:43:45,754 - test_collection_tiler - INFO - Response type: -2026-04-21 11:43:45,755 - test_collection_tiler - INFO - Test PASSED - -2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ -2026-04-21 11:43:46,028 - test_collection_tiler - INFO - TEST: test_02_get_collection_point -2026-04-21 11:43:46,028 - test_collection_tiler - INFO - ================================================================================ diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log deleted file mode 100644 index 8240cd964d6e..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/ingestion_test_results.log +++ /dev/null @@ -1,1043 +0,0 @@ -2026-04-21 10:39:34,349 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,350 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: List Managed Identities -2026-04-21 10:39:34,350 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,367 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,367 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create and List Ingestion Sources -2026-04-21 10:39:34,367 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,372 - test_planetary_computer_01_ingestion_management_async - WARNING - No managed identities found. Skipping test. -2026-04-21 10:39:34,387 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,387 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create SAS Token Ingestion Source -2026-04-21 10:39:34,387 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,388 - test_planetary_computer_01_ingestion_management_async - INFO - SAS Container URI: https://test.blob.core.windows.net/sas-container -2026-04-21 10:39:34,388 - test_planetary_computer_01_ingestion_management_async - INFO - SAS Token: sv=2021-01-01&st=202... -2026-04-21 10:39:34,395 - test_planetary_computer_01_ingestion_management_async - INFO - Created SAS token ingestion source: -2026-04-21 10:39:34,395 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,395 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: SharedAccessSignatureTokenIngestionSource -2026-04-21 10:39:34,398 - test_planetary_computer_01_ingestion_management_async - INFO - Cleaned up SAS source: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create Ingestion Definition -2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - Collection ID: naip -2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - Source Catalog URL: https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json -2026-04-21 10:39:34,416 - test_planetary_computer_01_ingestion_management_async - INFO - Deleting all existing ingestions... -2026-04-21 10:39:34,451 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,456 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,461 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,466 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,471 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,476 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,481 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,486 - test_planetary_computer_01_ingestion_management_async - INFO - Deleted existing ingestion: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - WARNING - Failed to delete ingestion 00000000-0000-0000-0000-000000000000: (ValidationError) Cannot delete ingestion while it has active runs. Cancel the runs first. -Code: ValidationError -Message: Cannot delete ingestion while it has active runs. Cancel the runs first. -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion definition created: -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Source Catalog URL: https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Keep Original Assets: True -2026-04-21 10:39:34,491 - test_planetary_computer_01_ingestion_management_async - INFO - - Skip Existing Items: True -2026-04-21 10:39:34,495 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion (object): 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,511 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,511 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Update Ingestion Definition -2026-04-21 10:39:34,511 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,519 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - Updated ingestion: -2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Updated Ingestion Name -2026-04-21 10:39:34,523 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:34,537 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,537 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create Ingestion Run -2026-04-21 10:39:34,537 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,551 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,554 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion run: -2026-04-21 10:39:34,554 - test_planetary_computer_01_ingestion_management_async - INFO - - Run ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,554 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,570 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,570 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Ingestion Run Status -2026-04-21 10:39:34,570 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,584 - test_planetary_computer_01_ingestion_management_async - INFO - Created run with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,586 - test_planetary_computer_01_ingestion_management_async - INFO - Run status: -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Total Items: 0 -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Successful Items: 0 -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Failed Items: 0 -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Pending Items: 0 -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - - Status History Entries: 1 -2026-04-21 10:39:34,587 - test_planetary_computer_01_ingestion_management_async - INFO - Entry 1: -2026-04-21 10:39:34,601 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,601 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: List Operations -2026-04-21 10:39:34,601 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,824 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.RUNNING -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,825 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,826 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,827 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,828 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,829 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,830 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,831 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,832 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,833 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,834 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,835 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,836 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,837 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,838 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,839 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,859 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,860 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,861 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,862 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,863 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,864 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,865 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,866 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,867 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteIngestion -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,868 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.CANCELED -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,869 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,870 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,871 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,872 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteCollection -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,873 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: DeleteItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,874 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.FAILED -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: UpdateItem -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,875 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,881 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,882 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddItem -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - Operation: -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.SUCCEEDED -2026-04-21 10:39:34,883 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: AddCollection -2026-04-21 10:39:34,907 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,907 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Operation by ID -2026-04-21 10:39:34,907 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,920 - test_planetary_computer_01_ingestion_management_async - INFO - Created operation with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - Retrieved operation: -2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:34,923 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:34,933 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,933 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Delete Ingestion Source -2026-04-21 10:39:34,933 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,939 - test_planetary_computer_01_ingestion_management_async - WARNING - No managed identities found. Skipping test. -2026-04-21 10:39:34,955 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,955 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Cancel Operation -2026-04-21 10:39:34,956 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,973 - test_planetary_computer_01_ingestion_management_async - INFO - Created operation with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,976 - test_planetary_computer_01_ingestion_management_async - INFO - Successfully requested cancellation for operation: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:34,989 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:34,989 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Cancel All Operations -2026-04-21 10:39:34,989 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:34,994 - test_planetary_computer_01_ingestion_management_async - INFO - Successfully requested cancellation for all operations -2026-04-21 10:39:35,006 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,006 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Source -2026-04-21 10:39:35,006 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,011 - test_planetary_computer_01_ingestion_management_async - WARNING - No managed identities found. Skipping test. -2026-04-21 10:39:35,026 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,026 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Create or Replace Source -2026-04-21 10:39:35,026 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,027 - test_planetary_computer_01_ingestion_management_async - INFO - Step 1: Creating initial SAS token ingestion source with create_source... -2026-04-21 10:39:35,036 - test_planetary_computer_01_ingestion_management_async - INFO - Created SAS token ingestion source: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,036 - test_planetary_computer_01_ingestion_management_async - INFO - Step 2: First call to create_or_replace_source with existing source ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,041 - test_planetary_computer_01_ingestion_management_async - INFO - First call result: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,041 - test_planetary_computer_01_ingestion_management_async - INFO - Step 3: Second call to create_or_replace_source with updated SAS token -2026-04-21 10:39:35,044 - test_planetary_computer_01_ingestion_management_async - INFO - Second create_or_replace result (replacement): -2026-04-21 10:39:35,045 - test_planetary_computer_01_ingestion_management_async - INFO - - Response type: -2026-04-21 10:39:35,045 - test_planetary_computer_01_ingestion_management_async - INFO - - Response: {'id': '00000000-0000-0000-0000-000000000000', 'kind': 'SasToken', 'connectionInfo': {'containerUrl': 'https://SANITIZED.blob.core.windows.net/sample-container', 'expiration': '2026-04-28T09:27:04.0000000Z'}} -2026-04-21 10:39:35,064 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,064 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Lists Ingestions -2026-04-21 10:39:35,064 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,076 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for List Runs Test -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Updated Ingestion Name -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,079 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Run -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Status Check -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Operation -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Cancel Test -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - Ingestion: -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Lists Test -2026-04-21 10:39:35,080 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,096 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,096 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Ingestion -2026-04-21 10:39:35,096 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,105 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,107 - test_planetary_computer_01_ingestion_management_async - INFO - Retrieved ingestion: -2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - Display Name: Ingestion for Get Test -2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - Import Type: IngestionType.STATIC_CATALOG -2026-04-21 10:39:35,108 - test_planetary_computer_01_ingestion_management_async - INFO - - Source Catalog URL: https://raw.githubusercontent.com/aloverro/mpcpro-sample-datasets/main/datasets/planetary_computer/naip/catalog.json -2026-04-21 10:39:35,126 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,126 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: List Runs -2026-04-21 10:39:35,126 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,138 - test_planetary_computer_01_ingestion_management_async - INFO - Created ingestion with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,143 - test_planetary_computer_01_ingestion_management_async - INFO - Created run with ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,146 - test_planetary_computer_01_ingestion_management_async - INFO - Run: -2026-04-21 10:39:35,147 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,147 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:35,147 - test_planetary_computer_01_ingestion_management_async - INFO - - Total Items: 0 -2026-04-21 10:39:35,162 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,163 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Get Operation (Additional Coverage) -2026-04-21 10:39:35,163 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,288 - test_planetary_computer_01_ingestion_management_async - INFO - Testing with operation ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - Retrieved operation: -2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - - ID: 00000000-0000-0000-0000-000000000000 -2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - - Status: OperationStatus.PENDING -2026-04-21 10:39:35,294 - test_planetary_computer_01_ingestion_management_async - INFO - - Type: IngestionStaticCatalog -2026-04-21 10:39:35,312 - test_planetary_computer_01_ingestion_management_async - INFO - -================================================================================ -2026-04-21 10:39:35,312 - test_planetary_computer_01_ingestion_management_async - INFO - TEST: Cancel All Operations (Additional Coverage) -2026-04-21 10:39:35,312 - test_planetary_computer_01_ingestion_management_async - INFO - ================================================================================ -2026-04-21 10:39:35,318 - test_planetary_computer_01_ingestion_management_async - INFO - Successfully requested cancellation for all operations diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log deleted file mode 100644 index 6f83addbfa4d..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/map_legends_test_results.log +++ /dev/null @@ -1,120 +0,0 @@ -2026-04-21 10:39:38,914 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,914 - test_map_legends - INFO - TEST: test_01_get_class_map_legend -2026-04-21 10:39:38,914 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,914 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,914 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY -2026-04-21 10:39:38,915 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) -2026-04-21 10:39:38,920 - test_map_legends - INFO - Response type: -2026-04-21 10:39:38,920 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} -2026-04-21 10:39:38,920 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:38,929 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,929 - test_map_legends - INFO - TEST: test_02_get_interval_legend -2026-04-21 10:39:38,929 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,930 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,930 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MODIS64_A1 -2026-04-21 10:39:38,930 - test_map_legends - INFO - Calling: get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) -2026-04-21 10:39:38,937 - test_map_legends - INFO - Response type: -2026-04-21 10:39:38,937 - test_map_legends - INFO - Response: [[[-2, 0], [0, 0, 0, 0]], [[1, 32], [255, 255, 178, 255]], [[32, 60], [255, 236, 147, 255]], [[60, 91], [254, 218, 115, 255]], [[91, 121], [254, 198, 89, 255]], [[121, 152], [254, 175, 77, 255]], [[152, 182], [253, 152, 66, 255]], [[182, 213], [251, 126, 55, 255]], [[213, 244], [246, 96, 45, 255]], [[244, 274], [241, 66, 35, 255]], [[274, 305], [226, 43, 34, 255]], [[305, 335], [208, 21, 36, 255]], [[335, 366], [189, 0, 38, 255]]] -2026-04-21 10:39:38,937 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:38,947 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,947 - test_map_legends - INFO - TEST: test_03_get_legend_as_png -2026-04-21 10:39:38,947 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,947 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,947 - test_map_legends - INFO - Input - color_map_name: rdylgn -2026-04-21 10:39:38,947 - test_map_legends - INFO - Calling: get_legend(color_map_name='rdylgn') -2026-04-21 10:39:38,953 - test_map_legends - INFO - Response type: -2026-04-21 10:39:38,954 - test_map_legends - INFO - Legend size: 550 bytes -2026-04-21 10:39:38,954 - test_map_legends - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 -2026-04-21 10:39:38,954 - test_map_legends - INFO - PNG magic bytes: 89504e470d0a1a0a -2026-04-21 10:39:38,954 - test_map_legends - INFO - Response starts with PNG magic: True -2026-04-21 10:39:38,954 - test_map_legends - INFO - PIL Image format: PNG -2026-04-21 10:39:38,954 - test_map_legends - INFO - PIL Image size: (387, 11) -2026-04-21 10:39:38,954 - test_map_legends - INFO - PIL Image mode: RGBA -2026-04-21 10:39:38,954 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:38,964 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,964 - test_map_legends - INFO - TEST: test_04_get_legend_with_different_colormap -2026-04-21 10:39:38,964 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,964 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,964 - test_map_legends - INFO - Input - color_map_name: viridis -2026-04-21 10:39:38,964 - test_map_legends - INFO - Calling: get_legend(color_map_name='viridis') -2026-04-21 10:39:38,968 - test_map_legends - INFO - Response type: -2026-04-21 10:39:38,968 - test_map_legends - INFO - Legend size: 533 bytes -2026-04-21 10:39:38,969 - test_map_legends - INFO - PIL Image format: PNG -2026-04-21 10:39:38,969 - test_map_legends - INFO - PIL Image size: (387, 11) -2026-04-21 10:39:38,969 - test_map_legends - INFO - PIL Image mode: RGBA -2026-04-21 10:39:38,969 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:38,977 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,978 - test_map_legends - INFO - TEST: test_05_class_map_legend_structure -2026-04-21 10:39:38,978 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,978 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,978 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY -2026-04-21 10:39:38,978 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) -2026-04-21 10:39:38,985 - test_map_legends - INFO - Response type: -2026-04-21 10:39:38,985 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} -2026-04-21 10:39:38,985 - test_map_legends - INFO - Found 7 classes with 6 unique non-transparent colors -2026-04-21 10:39:38,985 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:38,994 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,994 - test_map_legends - INFO - TEST: test_01_get_class_map_legend -2026-04-21 10:39:38,994 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:38,994 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,994 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY -2026-04-21 10:39:38,995 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) -2026-04-21 10:39:39,001 - test_map_legends - INFO - Response type: -2026-04-21 10:39:39,002 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} -2026-04-21 10:39:39,002 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:39,012 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,012 - test_map_legends - INFO - TEST: test_02_get_interval_legend -2026-04-21 10:39:39,013 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,013 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:39,013 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MODIS64_A1 -2026-04-21 10:39:39,013 - test_map_legends - INFO - Calling: get_interval_legend(classmap_name=ColorMapNames.MODIS64_A1) -2026-04-21 10:39:39,021 - test_map_legends - INFO - Response type: -2026-04-21 10:39:39,022 - test_map_legends - INFO - Response: [[[-2, 0], [0, 0, 0, 0]], [[1, 32], [255, 255, 178, 255]], [[32, 60], [255, 236, 147, 255]], [[60, 91], [254, 218, 115, 255]], [[91, 121], [254, 198, 89, 255]], [[121, 152], [254, 175, 77, 255]], [[152, 182], [253, 152, 66, 255]], [[182, 213], [251, 126, 55, 255]], [[213, 244], [246, 96, 45, 255]], [[244, 274], [241, 66, 35, 255]], [[274, 305], [226, 43, 34, 255]], [[305, 335], [208, 21, 36, 255]], [[335, 366], [189, 0, 38, 255]]] -2026-04-21 10:39:39,022 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:39,033 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,033 - test_map_legends - INFO - TEST: test_03_get_legend_as_png -2026-04-21 10:39:39,033 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,033 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:39,033 - test_map_legends - INFO - Input - color_map_name: rdylgn -2026-04-21 10:39:39,034 - test_map_legends - INFO - Calling: get_legend(color_map_name='rdylgn') -2026-04-21 10:39:39,038 - test_map_legends - INFO - Response type: -2026-04-21 10:39:39,039 - test_map_legends - INFO - Legend size: 550 bytes -2026-04-21 10:39:39,039 - test_map_legends - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 -2026-04-21 10:39:39,039 - test_map_legends - INFO - PNG magic bytes: 89504e470d0a1a0a -2026-04-21 10:39:39,039 - test_map_legends - INFO - Response starts with PNG magic: True -2026-04-21 10:39:39,039 - test_map_legends - INFO - PIL Image format: PNG -2026-04-21 10:39:39,039 - test_map_legends - INFO - PIL Image size: (387, 11) -2026-04-21 10:39:39,039 - test_map_legends - INFO - PIL Image mode: RGBA -2026-04-21 10:39:39,039 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:39,050 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,050 - test_map_legends - INFO - TEST: test_04_get_legend_with_different_colormap -2026-04-21 10:39:39,050 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,050 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:39,050 - test_map_legends - INFO - Input - color_map_name: viridis -2026-04-21 10:39:39,050 - test_map_legends - INFO - Calling: get_legend(color_map_name='viridis') -2026-04-21 10:39:39,055 - test_map_legends - INFO - Response type: -2026-04-21 10:39:39,055 - test_map_legends - INFO - Legend size: 533 bytes -2026-04-21 10:39:39,056 - test_map_legends - INFO - PIL Image format: PNG -2026-04-21 10:39:39,056 - test_map_legends - INFO - PIL Image size: (387, 11) -2026-04-21 10:39:39,056 - test_map_legends - INFO - PIL Image mode: RGBA -2026-04-21 10:39:39,056 - test_map_legends - INFO - Test PASSED - -2026-04-21 10:39:39,068 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,068 - test_map_legends - INFO - TEST: test_05_class_map_legend_structure -2026-04-21 10:39:39,068 - test_map_legends - INFO - ================================================================================ -2026-04-21 10:39:39,068 - test_map_legends - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:39,068 - test_map_legends - INFO - Input - classmap_name: ColorMapNames.MTBS_SEVERITY -2026-04-21 10:39:39,068 - test_map_legends - INFO - Calling: get_class_map_legend(classmap_name=ColorMapNames.MTBS_SEVERITY) -2026-04-21 10:39:39,075 - test_map_legends - INFO - Response type: -2026-04-21 10:39:39,075 - test_map_legends - INFO - Response: {'0': [0, 0, 0, 0], '1': [0, 100, 0, 255], '2': [127, 255, 212, 255], '3': [255, 255, 0, 255], '4': [255, 0, 0, 255], '5': [127, 255, 0, 255], '6': [255, 255, 255, 255]} -2026-04-21 10:39:39,075 - test_map_legends - INFO - Found 7 classes with 6 unique non-transparent colors -2026-04-21 10:39:39,075 - test_map_legends - INFO - Test PASSED - diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log deleted file mode 100644 index a07369fd1f72..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/mosaics_tiler_test_results.log +++ /dev/null @@ -1,8 +0,0 @@ -2026-04-21 11:38:19,379 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - TEST: test_04_get_mosaics_tile -2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - ================================================================================ -2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - Input - endpoint: https://stablecat.gjehh4bsh5hdeegx.uksouth.geocatalog.ppe.spatio.azure-test.net -2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - Input - collection_id: naip -2026-04-21 11:38:19,380 - test_mosaics_tiler - INFO - Input - tile coordinates: z=13, x=2174, y=3282 -2026-04-21 11:38:21,730 - test_mosaics_tiler - INFO - Using search ID: 5bdb874db9ec386ccd82e56af5d216a3 -2026-04-21 11:38:21,730 - test_mosaics_tiler - INFO - Calling: get_mosaics_tile(...) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log deleted file mode 100644 index 4cd1c3bd5b30..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_collection_test_results.log +++ /dev/null @@ -1,523 +0,0 @@ -2026-04-21 10:39:04,688 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:04,688 - test_stac_collection - INFO - TEST: test_01_list_collections -2026-04-21 10:39:04,688 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:04,689 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:04,749 - test_stac_collection - INFO - Calling: get_collections() -2026-04-21 10:39:05,129 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,129 - test_stac_collection - INFO - Number of collections: 7 -2026-04-21 10:39:05,129 - test_stac_collection - INFO - First collection ID: sentinel-2 -2026-04-21 10:39:05,129 - test_stac_collection - INFO - First collection title: Sentinel-2 Test -2026-04-21 10:39:05,129 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,165 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,165 - test_stac_collection - INFO - TEST: test_02_get_conformance_class -2026-04-21 10:39:05,165 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,165 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,166 - test_stac_collection - INFO - Calling: get_conformance_class() -2026-04-21 10:39:05,188 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,188 - test_stac_collection - INFO - Response keys: ['conformsTo'] -2026-04-21 10:39:05,189 - test_stac_collection - INFO - Number of conformance classes: 15 -2026-04-21 10:39:05,189 - test_stac_collection - INFO - 1. http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2 -2026-04-21 10:39:05,189 - test_stac_collection - INFO - 2. http://www.opengis.net/spec/cql2/1.0/conf/cql2-json -2026-04-21 10:39:05,189 - test_stac_collection - INFO - 3. http://www.opengis.net/spec/cql2/1.0/conf/cql2-text -2026-04-21 10:39:05,189 - test_stac_collection - INFO - 4. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core -2026-04-21 10:39:05,189 - test_stac_collection - INFO - 5. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson -2026-04-21 10:39:05,189 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,211 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,212 - test_stac_collection - INFO - TEST: test_03_get_collection -2026-04-21 10:39:05,212 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,212 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,212 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,212 - test_stac_collection - INFO - Calling: get_collection(collection_id='naip') -2026-04-21 10:39:05,244 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,244 - test_stac_collection - INFO - Collection ID: naip -2026-04-21 10:39:05,244 - test_stac_collection - INFO - Collection Title: NAIP Test Dataset -2026-04-21 10:39:05,244 - test_stac_collection - INFO - Collection Description: NAIP imagery for SDK testing... -2026-04-21 10:39:05,244 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,260 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,261 - test_stac_collection - INFO - TEST: test_04_get_partition_type -2026-04-21 10:39:05,261 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,261 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,261 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,261 - test_stac_collection - INFO - Calling: get_partition_type(collection_id='naip') -2026-04-21 10:39:05,269 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,269 - test_stac_collection - INFO - Partition scheme: PartitionTypeScheme.NONE -2026-04-21 10:39:05,269 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,283 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,283 - test_stac_collection - INFO - TEST: test_05_list_render_options -2026-04-21 10:39:05,283 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,283 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,283 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,283 - test_stac_collection - INFO - Calling: list_render_options(collection_id='naip') -2026-04-21 10:39:05,293 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,293 - test_stac_collection - INFO - Number of render options: 2 -2026-04-21 10:39:05,293 - test_stac_collection - INFO - First render option ID: natural-color -2026-04-21 10:39:05,294 - test_stac_collection - INFO - First render option name: Natural color -2026-04-21 10:39:05,294 - test_stac_collection - INFO - First render option type: RenderOptionType.RASTER_TILE -2026-04-21 10:39:05,294 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,308 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,309 - test_stac_collection - INFO - TEST: test_06_get_tile_settings -2026-04-21 10:39:05,309 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,309 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,309 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,309 - test_stac_collection - INFO - Calling: get_tile_settings(collection_id='naip') -2026-04-21 10:39:05,318 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,318 - test_stac_collection - INFO - Response keys: ['minZoom', 'maxItemsPerTile', 'defaultLocation'] -2026-04-21 10:39:05,318 - test_stac_collection - INFO - Max items per tile: 35 -2026-04-21 10:39:05,318 - test_stac_collection - INFO - Min zoom: 6 -2026-04-21 10:39:05,318 - test_stac_collection - INFO - Default location: None -2026-04-21 10:39:05,318 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,333 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,333 - test_stac_collection - INFO - TEST: test_07_list_mosaics -2026-04-21 10:39:05,333 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,333 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,333 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,334 - test_stac_collection - INFO - Calling: list_mosaics(collection_id='naip') -2026-04-21 10:39:05,344 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,344 - test_stac_collection - INFO - Number of mosaics: 2 -2026-04-21 10:39:05,344 - test_stac_collection - INFO - First mosaic ID: default -2026-04-21 10:39:05,344 - test_stac_collection - INFO - First mosaic name: Default -2026-04-21 10:39:05,344 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,360 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,360 - test_stac_collection - INFO - TEST: test_08_get_collection_queryables -2026-04-21 10:39:05,360 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,360 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,360 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,361 - test_stac_collection - INFO - Calling: get_collection_queryables(collection_id='naip') -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Number of queryables: 4 -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 1: id -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 2: datetime -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 3: geometry -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Queryable 4: test:property -2026-04-21 10:39:05,377 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,393 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,393 - test_stac_collection - INFO - TEST: test_09_list_queryables -2026-04-21 10:39:05,393 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,393 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,394 - test_stac_collection - INFO - Calling: list_queryables() -2026-04-21 10:39:05,407 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,407 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] -2026-04-21 10:39:05,407 - test_stac_collection - INFO - Number of global queryables: 4 -2026-04-21 10:39:05,407 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,421 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,421 - test_stac_collection - INFO - TEST: test_10_get_collection_configuration -2026-04-21 10:39:05,421 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,421 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,421 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,422 - test_stac_collection - INFO - Calling: get_collection_configuration(collection_id='naip') -2026-04-21 10:39:05,437 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,438 - test_stac_collection - INFO - Response keys: ['tileSettings', 'mosaicInfo'] -2026-04-21 10:39:05,438 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,456 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,456 - test_stac_collection - INFO - TEST: test_10a_create_thumbnail_asset -2026-04-21 10:39:05,456 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,456 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,456 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,456 - test_stac_collection - INFO - Checking if asset 'thumbnail' already exists and deleting if found... -2026-04-21 10:39:05,515 - test_stac_collection - INFO - Deleted existing 'thumbnail' -2026-04-21 10:39:05,515 - test_stac_collection - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) -2026-04-21 10:39:05,530 - test_stac_collection - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:22:56.272914Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}, 'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}}} -2026-04-21 10:39:05,534 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,551 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,551 - test_stac_collection - INFO - TEST: test_11_get_collection_thumbnail -2026-04-21 10:39:05,551 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,551 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:05,551 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:05,573 - test_stac_collection - INFO - Calling: get_collection_thumbnail(collection_id='naip') -2026-04-21 10:39:05,576 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:05,576 - test_stac_collection - INFO - Thumbnail size: 75 bytes -2026-04-21 10:39:05,576 - test_stac_collection - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 -2026-04-21 10:39:05,576 - test_stac_collection - INFO - Thumbnail format: PNG -2026-04-21 10:39:05,576 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,592 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,592 - test_stac_collection - INFO - TEST: test_12_create_render_option -2026-04-21 10:39:05,592 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,605 - test_stac_collection - INFO - Render option 'test-natural-color' already exists, deleting it first -2026-04-21 10:39:05,610 - test_stac_collection - INFO - Existing render option deleted -2026-04-21 10:39:05,610 - test_stac_collection - INFO - Calling: create_render_option(collection_id='naip', body={'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) -2026-04-21 10:39:05,617 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} -2026-04-21 10:39:05,617 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,630 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,630 - test_stac_collection - INFO - TEST: test_13_get_render_option -2026-04-21 10:39:05,630 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,630 - test_stac_collection - INFO - Calling: get_render_option(collection_id='naip', render_option_id='test-natural-color') -2026-04-21 10:39:05,638 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} -2026-04-21 10:39:05,638 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,658 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,658 - test_stac_collection - INFO - TEST: test_14_replace_render_option -2026-04-21 10:39:05,658 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,658 - test_stac_collection - INFO - Calling: create_or_replace_render_option(collection_id='naip', render_option_id='test-natural-color', body={'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) -2026-04-21 10:39:05,674 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} -2026-04-21 10:39:05,674 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,690 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,690 - test_stac_collection - INFO - TEST: test_14a_delete_render_option -2026-04-21 10:39:05,691 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,691 - test_stac_collection - INFO - Creating render option for deletion: test-render-opt-delete -2026-04-21 10:39:05,717 - test_stac_collection - INFO - Render option created successfully -2026-04-21 10:39:05,717 - test_stac_collection - INFO - Calling: delete_render_option(collection_id='naip', render_option_id='test-render-opt-delete') -2026-04-21 10:39:05,725 - test_stac_collection - INFO - Render option deleted successfully -2026-04-21 10:39:05,730 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Render Option 'test-render-opt-delete' not found for collection 'naip' -Code: ResourceNotFound -Message: Render Option 'test-render-opt-delete' not found for collection 'naip' -2026-04-21 10:39:05,730 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,746 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,746 - test_stac_collection - INFO - TEST: test_15_add_mosaic -2026-04-21 10:39:05,746 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,758 - test_stac_collection - INFO - Mosaic 'test-mosaic-1' already exists, deleting it first -2026-04-21 10:39:05,764 - test_stac_collection - INFO - Existing mosaic deleted -2026-04-21 10:39:05,765 - test_stac_collection - INFO - Calling: add_mosaic(collection_id='naip', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'cql': []}) -2026-04-21 10:39:05,772 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} -2026-04-21 10:39:05,772 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,794 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,799 - test_stac_collection - INFO - TEST: test_16_get_mosaic -2026-04-21 10:39:05,799 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,800 - test_stac_collection - INFO - Calling: get_mosaic(collection_id='naip', mosaic_id='test-mosaic-1') -2026-04-21 10:39:05,807 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} -2026-04-21 10:39:05,808 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,825 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,825 - test_stac_collection - INFO - TEST: test_17_replace_mosaic -2026-04-21 10:39:05,825 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,825 - test_stac_collection - INFO - Calling: create_or_replace_mosaic(collection_id='naip', mosaic_id='test-mosaic-1', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []}) -2026-04-21 10:39:05,839 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []} -2026-04-21 10:39:05,839 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,929 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,929 - test_stac_collection - INFO - TEST: test_17a_delete_mosaic -2026-04-21 10:39:05,929 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,930 - test_stac_collection - INFO - Creating mosaic for deletion: test-mosaic-to-be-deleted -2026-04-21 10:39:05,968 - test_stac_collection - INFO - Mosaic created successfully -2026-04-21 10:39:05,968 - test_stac_collection - INFO - Calling: delete_mosaic(collection_id='naip', mosaic_id='test-mosaic-to-be-deleted') -2026-04-21 10:39:05,972 - test_stac_collection - INFO - Mosaic deleted successfully -2026-04-21 10:39:05,976 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' -Code: ResourceNotFound -Message: Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' -2026-04-21 10:39:05,976 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:05,993 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,993 - test_stac_collection - INFO - TEST: test_18_replace_partition_type -2026-04-21 10:39:05,993 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:05,993 - test_stac_collection - INFO - Creating temporary collection: test-partition-type-collection -2026-04-21 10:39:06,068 - test_stac_collection - INFO - Collection 'test-partition-type-collection' does not exist, proceeding with creation -2026-04-21 10:39:06,068 - test_stac_collection - INFO - Creating collection using begin_create_collection -2026-04-21 10:39:06,096 - test_stac_collection - INFO - Temporary collection created -2026-04-21 10:39:06,096 - test_stac_collection - INFO - Calling: replace_partition_type(collection_id='test-partition-type-collection', body={'scheme': 'year'}) -2026-04-21 10:39:06,107 - test_stac_collection - INFO - Partition type set successfully -2026-04-21 10:39:06,107 - test_stac_collection - INFO - Deleting temporary collection: test-partition-type-collection -2026-04-21 10:39:06,118 - test_stac_collection - INFO - Temporary collection deleted -2026-04-21 10:39:06,118 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,142 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,142 - test_stac_collection - INFO - TEST: test_19_replace_tile_settings -2026-04-21 10:39:06,142 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,143 - test_stac_collection - INFO - Calling: replace_tile_settings(collection_id='naip', body={'maxItemsPerTile': 35, 'minZoom': 6}) -2026-04-21 10:39:06,155 - test_stac_collection - INFO - Response: {'minZoom': 6, 'maxItemsPerTile': 35, 'defaultLocation': None} -2026-04-21 10:39:06,155 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,171 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,171 - test_stac_collection - INFO - TEST: test_20_create_queryables -2026-04-21 10:39:06,171 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,194 - test_stac_collection - INFO - Queryable 'test:property' already exists, deleting it first -2026-04-21 10:39:06,199 - test_stac_collection - INFO - Existing queryable deleted -2026-04-21 10:39:06,200 - test_stac_collection - INFO - Calling: create_queryables(collection_id='naip', body=[queryable]) -2026-04-21 10:39:06,207 - test_stac_collection - INFO - Response: [{'name': 'test:property', 'definition': {'data_type': 'number'}, 'create_index': False, 'data_type': 'number'}] -2026-04-21 10:39:06,208 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,221 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,222 - test_stac_collection - INFO - TEST: test_21_replace_queryable -2026-04-21 10:39:06,222 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,222 - test_stac_collection - INFO - Calling: create_or_replace_queryable(collection_id='naip', queryable_name='test:property', body=queryable) -2026-04-21 10:39:06,238 - test_stac_collection - INFO - Response: {'name': 'test:property', 'definition': {'description': 'Test property - updated'}, 'create_index': False, 'data_type': None} -2026-04-21 10:39:06,238 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,255 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,255 - test_stac_collection - INFO - TEST: test_21a_delete_queryable -2026-04-21 10:39:06,255 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,255 - test_stac_collection - INFO - Creating queryable for deletion: test:property_to_be_deleted -2026-04-21 10:39:06,291 - test_stac_collection - INFO - Queryable created successfully -2026-04-21 10:39:06,291 - test_stac_collection - INFO - Calling: delete_queryable(collection_id='naip', queryable_name='test:property_to_be_deleted') -2026-04-21 10:39:06,295 - test_stac_collection - INFO - Queryable deleted successfully -2026-04-21 10:39:06,302 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,323 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,323 - test_stac_collection - INFO - TEST: test_01_list_collections -2026-04-21 10:39:06,323 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,324 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,324 - test_stac_collection - INFO - Calling: get_collections() -2026-04-21 10:39:06,438 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,439 - test_stac_collection - INFO - Number of collections: 7 -2026-04-21 10:39:06,439 - test_stac_collection - INFO - First collection ID: sentinel-2 -2026-04-21 10:39:06,439 - test_stac_collection - INFO - First collection title: Sentinel-2 Test -2026-04-21 10:39:06,439 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,466 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,466 - test_stac_collection - INFO - TEST: test_02_get_conformance_class -2026-04-21 10:39:06,466 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,467 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,467 - test_stac_collection - INFO - Calling: get_conformance_class() -2026-04-21 10:39:06,479 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,479 - test_stac_collection - INFO - Response keys: ['conformsTo'] -2026-04-21 10:39:06,479 - test_stac_collection - INFO - Number of conformance classes: 15 -2026-04-21 10:39:06,479 - test_stac_collection - INFO - 1. http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2 -2026-04-21 10:39:06,479 - test_stac_collection - INFO - 2. http://www.opengis.net/spec/cql2/1.0/conf/cql2-json -2026-04-21 10:39:06,479 - test_stac_collection - INFO - 3. http://www.opengis.net/spec/cql2/1.0/conf/cql2-text -2026-04-21 10:39:06,479 - test_stac_collection - INFO - 4. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core -2026-04-21 10:39:06,479 - test_stac_collection - INFO - 5. http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson -2026-04-21 10:39:06,479 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,497 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,497 - test_stac_collection - INFO - TEST: test_03_get_collection -2026-04-21 10:39:06,497 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,497 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,497 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,498 - test_stac_collection - INFO - Calling: get_collection(collection_id='naip') -2026-04-21 10:39:06,518 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,518 - test_stac_collection - INFO - Collection ID: naip -2026-04-21 10:39:06,518 - test_stac_collection - INFO - Collection Title: NAIP Test Dataset -2026-04-21 10:39:06,518 - test_stac_collection - INFO - Collection Description: NAIP imagery for SDK testing... -2026-04-21 10:39:06,518 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,543 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,543 - test_stac_collection - INFO - TEST: test_04_get_partition_type -2026-04-21 10:39:06,544 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,544 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,544 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,544 - test_stac_collection - INFO - Calling: get_partition_type(collection_id='naip') -2026-04-21 10:39:06,552 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,552 - test_stac_collection - INFO - Partition scheme: PartitionTypeScheme.NONE -2026-04-21 10:39:06,552 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,574 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,574 - test_stac_collection - INFO - TEST: test_05_list_render_options -2026-04-21 10:39:06,574 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,574 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,575 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,575 - test_stac_collection - INFO - Calling: list_render_options(collection_id='naip') -2026-04-21 10:39:06,588 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,589 - test_stac_collection - INFO - Number of render options: 2 -2026-04-21 10:39:06,589 - test_stac_collection - INFO - First render option ID: natural-color -2026-04-21 10:39:06,589 - test_stac_collection - INFO - First render option name: Natural color -2026-04-21 10:39:06,589 - test_stac_collection - INFO - First render option type: RenderOptionType.RASTER_TILE -2026-04-21 10:39:06,589 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,604 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,604 - test_stac_collection - INFO - TEST: test_06_get_tile_settings -2026-04-21 10:39:06,605 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,605 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,605 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,605 - test_stac_collection - INFO - Calling: get_tile_settings(collection_id='naip') -2026-04-21 10:39:06,613 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,614 - test_stac_collection - INFO - Response keys: ['minZoom', 'maxItemsPerTile', 'defaultLocation'] -2026-04-21 10:39:06,614 - test_stac_collection - INFO - Max items per tile: 35 -2026-04-21 10:39:06,614 - test_stac_collection - INFO - Min zoom: 6 -2026-04-21 10:39:06,614 - test_stac_collection - INFO - Default location: None -2026-04-21 10:39:06,614 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,630 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,630 - test_stac_collection - INFO - TEST: test_07_list_mosaics -2026-04-21 10:39:06,630 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,630 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,630 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,631 - test_stac_collection - INFO - Calling: list_mosaics(collection_id='naip') -2026-04-21 10:39:06,642 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,642 - test_stac_collection - INFO - Number of mosaics: 2 -2026-04-21 10:39:06,643 - test_stac_collection - INFO - First mosaic ID: default -2026-04-21 10:39:06,643 - test_stac_collection - INFO - First mosaic name: Default -2026-04-21 10:39:06,643 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,663 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,663 - test_stac_collection - INFO - TEST: test_08_get_collection_queryables -2026-04-21 10:39:06,664 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,664 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,664 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,664 - test_stac_collection - INFO - Calling: get_collection_queryables(collection_id='naip') -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Number of queryables: 4 -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 1: id -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 2: datetime -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 3: geometry -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Queryable 4: test:property -2026-04-21 10:39:06,743 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,765 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,765 - test_stac_collection - INFO - TEST: test_09_list_queryables -2026-04-21 10:39:06,765 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,765 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,766 - test_stac_collection - INFO - Calling: list_queryables() -2026-04-21 10:39:06,785 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,785 - test_stac_collection - INFO - Response keys: ['$id', 'type', 'title', '$schema', 'properties', 'additionalProperties'] -2026-04-21 10:39:06,785 - test_stac_collection - INFO - Number of global queryables: 4 -2026-04-21 10:39:06,785 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,800 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,801 - test_stac_collection - INFO - TEST: test_10_get_collection_configuration -2026-04-21 10:39:06,801 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,801 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,801 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,801 - test_stac_collection - INFO - Calling: get_collection_configuration(collection_id='naip') -2026-04-21 10:39:06,823 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:06,823 - test_stac_collection - INFO - Response keys: ['tileSettings', 'mosaicInfo'] -2026-04-21 10:39:06,823 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,841 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,841 - test_stac_collection - INFO - TEST: test_10a_create_thumbnail_asset -2026-04-21 10:39:06,841 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,841 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,842 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,842 - test_stac_collection - INFO - Checking if asset 'thumbnail' already exists and deleting if found... -2026-04-21 10:39:06,916 - test_stac_collection - INFO - Deleted existing 'thumbnail' -2026-04-21 10:39:06,917 - test_stac_collection - INFO - Calling: create_collection_asset(collection_id='naip', body={...}) -2026-04-21 10:39:06,924 - test_stac_collection - INFO - Response: {'type': 'Collection', 'id': 'naip', 'stac_version': '1.0.0', 'description': 'NAIP imagery for SDK testing', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com/stac/collections/naip'}], 'item_assets': {'image': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'RGBIR COG tile'}}, 'msft:_created': '2026-04-16T11:51:49.2030049Z', 'msft:_updated': '2026-04-21T09:24:32.311624Z', 'title': 'NAIP Test Dataset', 'extent': {'spatial': {'bbox': [[-85.605165, 30.357851, -80.839729, 35.000659]]}, 'temporal': {'interval': [['2020-01-01T00:00:00Z', '2099-12-31T23:59:59Z']]}}, 'license': 'proprietary', 'assets': {'test-asset': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/test-asset/test-asset.txt', 'type': 'text/plain', 'title': 'Test Asset - Updated', 'roles': ['metadata']}, 'thumbnail': {'href': 'https://SANITIZED.blob.core.windows.net/naip-bf48131e/collection-assets/thumbnail/thumbnail.png', 'type': 'image/png', 'title': 'Collection Thumbnail', 'roles': ['thumbnail']}}} -2026-04-21 10:39:06,928 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:06,944 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,944 - test_stac_collection - INFO - TEST: test_11_get_collection_thumbnail -2026-04-21 10:39:06,944 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:06,944 - test_stac_collection - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:06,944 - test_stac_collection - INFO - Input - collection_id: naip -2026-04-21 10:39:06,999 - test_stac_collection - INFO - Calling: get_collection_thumbnail(collection_id='naip') -2026-04-21 10:39:07,003 - test_stac_collection - INFO - Response type: -2026-04-21 10:39:07,003 - test_stac_collection - INFO - Thumbnail size: 75 bytes -2026-04-21 10:39:07,003 - test_stac_collection - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 -2026-04-21 10:39:07,003 - test_stac_collection - INFO - Thumbnail format: PNG -2026-04-21 10:39:07,003 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,020 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,024 - test_stac_collection - INFO - TEST: test_12_create_render_option -2026-04-21 10:39:07,024 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,040 - test_stac_collection - INFO - Render option 'test-natural-color' already exists, deleting it first -2026-04-21 10:39:07,045 - test_stac_collection - INFO - Existing render option deleted -2026-04-21 10:39:07,045 - test_stac_collection - INFO - Calling: create_render_option(collection_id='naip', body={'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) -2026-04-21 10:39:07,053 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} -2026-04-21 10:39:07,053 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,067 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,067 - test_stac_collection - INFO - TEST: test_13_get_render_option -2026-04-21 10:39:07,068 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,068 - test_stac_collection - INFO - Calling: get_render_option(collection_id='naip', render_option_id='test-natural-color') -2026-04-21 10:39:07,077 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} -2026-04-21 10:39:07,077 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,092 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,092 - test_stac_collection - INFO - TEST: test_14_replace_render_option -2026-04-21 10:39:07,092 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,092 - test_stac_collection - INFO - Calling: create_or_replace_render_option(collection_id='naip', render_option_id='test-natural-color', body={'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6}) -2026-04-21 10:39:07,121 - test_stac_collection - INFO - Response: {'id': 'test-natural-color', 'name': 'Test Natural color updated', 'description': 'RGB from visual assets - updated', 'type': 'raster-tile', 'options': 'assets=image&asset_bidx=image|1,2,3', 'minZoom': 6} -2026-04-21 10:39:07,121 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,140 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,140 - test_stac_collection - INFO - TEST: test_14a_delete_render_option -2026-04-21 10:39:07,140 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,141 - test_stac_collection - INFO - Creating render option for deletion: test-render-opt-delete -2026-04-21 10:39:07,171 - test_stac_collection - INFO - Render option created successfully -2026-04-21 10:39:07,172 - test_stac_collection - INFO - Calling: delete_render_option(collection_id='naip', render_option_id='test-render-opt-delete') -2026-04-21 10:39:07,176 - test_stac_collection - INFO - Render option deleted successfully -2026-04-21 10:39:07,180 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Render Option 'test-render-opt-delete' not found for collection 'naip' -Code: ResourceNotFound -Message: Render Option 'test-render-opt-delete' not found for collection 'naip' -2026-04-21 10:39:07,180 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,197 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,197 - test_stac_collection - INFO - TEST: test_15_add_mosaic -2026-04-21 10:39:07,197 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,213 - test_stac_collection - INFO - Mosaic 'test-mosaic-1' already exists, deleting it first -2026-04-21 10:39:07,216 - test_stac_collection - INFO - Existing mosaic deleted -2026-04-21 10:39:07,217 - test_stac_collection - INFO - Calling: add_mosaic(collection_id='naip', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'cql': []}) -2026-04-21 10:39:07,222 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} -2026-04-21 10:39:07,223 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,236 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,237 - test_stac_collection - INFO - TEST: test_16_get_mosaic -2026-04-21 10:39:07,237 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,237 - test_stac_collection - INFO - Calling: get_mosaic(collection_id='naip', mosaic_id='test-mosaic-1') -2026-04-21 10:39:07,246 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': None, 'cql': []} -2026-04-21 10:39:07,247 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,261 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,261 - test_stac_collection - INFO - TEST: test_17_replace_mosaic -2026-04-21 10:39:07,261 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,262 - test_stac_collection - INFO - Calling: create_or_replace_mosaic(collection_id='naip', mosaic_id='test-mosaic-1', body={'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []}) -2026-04-21 10:39:07,276 - test_stac_collection - INFO - Response: {'id': 'test-mosaic-1', 'name': 'Test Most recent available', 'description': 'Most recent available imagery in this collection - updated', 'cql': []} -2026-04-21 10:39:07,276 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,291 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,291 - test_stac_collection - INFO - TEST: test_17a_delete_mosaic -2026-04-21 10:39:07,291 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,292 - test_stac_collection - INFO - Creating mosaic for deletion: test-mosaic-to-be-deleted -2026-04-21 10:39:07,315 - test_stac_collection - INFO - Mosaic created successfully -2026-04-21 10:39:07,315 - test_stac_collection - INFO - Calling: delete_mosaic(collection_id='naip', mosaic_id='test-mosaic-to-be-deleted') -2026-04-21 10:39:07,318 - test_stac_collection - INFO - Mosaic deleted successfully -2026-04-21 10:39:07,321 - test_stac_collection - INFO - Confirmed deletion (404 expected): (ResourceNotFound) Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' -Code: ResourceNotFound -Message: Mosaic 'test-mosaic-to-be-deleted' not found for collection 'naip' -2026-04-21 10:39:07,321 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:07,337 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,337 - test_stac_collection - INFO - TEST: test_18_replace_partition_type -2026-04-21 10:39:07,337 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:07,338 - test_stac_collection - INFO - Creating temporary collection: test-partition-type-collection -2026-04-21 10:39:07,440 - test_stac_collection - INFO - Collection 'test-partition-type-collection' does not exist, proceeding with creation -2026-04-21 10:39:07,440 - test_stac_collection - INFO - Creating collection using begin_create_collection -2026-04-21 10:39:07,453 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 1/12) -2026-04-21 10:39:12,554 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 2/12) -2026-04-21 10:39:17,577 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 3/12) -2026-04-21 10:39:22,589 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 4/12) -2026-04-21 10:39:27,610 - test_stac_collection - INFO - Collection still being deleted, retrying in 5s (attempt 5/12) -2026-04-21 10:39:32,651 - test_stac_collection - INFO - Temporary collection created -2026-04-21 10:39:32,652 - test_stac_collection - INFO - Calling: replace_partition_type(collection_id='test-partition-type-collection', body={'scheme': 'year'}) -2026-04-21 10:39:32,662 - test_stac_collection - INFO - Partition type set successfully -2026-04-21 10:39:32,662 - test_stac_collection - INFO - Deleting temporary collection: test-partition-type-collection -2026-04-21 10:39:32,671 - test_stac_collection - INFO - Temporary collection deleted -2026-04-21 10:39:32,671 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:32,739 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,739 - test_stac_collection - INFO - TEST: test_19_replace_tile_settings -2026-04-21 10:39:32,740 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,741 - test_stac_collection - INFO - Calling: replace_tile_settings(collection_id='naip', body={'maxItemsPerTile': 35, 'minZoom': 6}) -2026-04-21 10:39:32,752 - test_stac_collection - INFO - Response: {'minZoom': 6, 'maxItemsPerTile': 35, 'defaultLocation': None} -2026-04-21 10:39:32,752 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:32,808 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,809 - test_stac_collection - INFO - TEST: test_20_create_queryables -2026-04-21 10:39:32,809 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,820 - test_stac_collection - INFO - Queryable 'test:property' already exists, deleting it first -2026-04-21 10:39:32,824 - test_stac_collection - INFO - Existing queryable deleted -2026-04-21 10:39:32,824 - test_stac_collection - INFO - Calling: create_queryables(collection_id='naip', body=[queryable]) -2026-04-21 10:39:32,828 - test_stac_collection - INFO - Response: [{'name': 'test:property', 'definition': {'data_type': 'number'}, 'create_index': False, 'data_type': 'number'}] -2026-04-21 10:39:32,828 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:32,847 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,847 - test_stac_collection - INFO - TEST: test_21_replace_queryable -2026-04-21 10:39:32,847 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,848 - test_stac_collection - INFO - Calling: create_or_replace_queryable(collection_id='naip', queryable_name='test:property', body=queryable) -2026-04-21 10:39:32,859 - test_stac_collection - INFO - Response: {'name': 'test:property', 'definition': {'description': 'Test property - updated'}, 'create_index': False, 'data_type': None} -2026-04-21 10:39:32,859 - test_stac_collection - INFO - Test PASSED - -2026-04-21 10:39:32,883 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,883 - test_stac_collection - INFO - TEST: test_21a_delete_queryable -2026-04-21 10:39:32,883 - test_stac_collection - INFO - ================================================================================ -2026-04-21 10:39:32,883 - test_stac_collection - INFO - Creating queryable for deletion: test:property_to_be_deleted -2026-04-21 10:39:32,900 - test_stac_collection - INFO - Queryable created successfully -2026-04-21 10:39:32,900 - test_stac_collection - INFO - Calling: delete_queryable(collection_id='naip', queryable_name='test:property_to_be_deleted') -2026-04-21 10:39:32,904 - test_stac_collection - INFO - Queryable deleted successfully -2026-04-21 10:39:32,910 - test_stac_collection - INFO - Test PASSED - diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log deleted file mode 100644 index 3e59728a8b09..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_item_tiler_test_results.log +++ /dev/null @@ -1,382 +0,0 @@ -2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - TEST: test_01_get_tile_matrix_definitions -2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - Input - tile_matrix_set_id: WebMercatorQuad -2026-04-21 10:39:37,077 - test_stac_item_tiler - INFO - Calling: get_tile_matrix_definitions(tile_matrix_set_id='WebMercatorQuad') -2026-04-21 10:39:37,116 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,116 - test_stac_item_tiler - INFO - Response keys: ['title', 'description', 'keywords', 'id', 'uri', 'orderedAxes', 'crs', 'wellKnownScaleSet', 'boundingBox', 'tileMatrices'] -2026-04-21 10:39:37,116 - test_stac_item_tiler - INFO - Number of tile matrices: 25 -2026-04-21 10:39:37,117 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - TEST: test_02_list_tile_matrices -2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,125 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,126 - test_stac_item_tiler - INFO - Calling: list_tile_matrices() -2026-04-21 10:39:37,130 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,130 - test_stac_item_tiler - INFO - Response: ['CDB1GlobalGrid', 'CanadianNAD83_LCC', 'EuropeanETRS89_LAEAQuad', 'GNOSISGlobalGrid', 'LINZAntarticaMapTilegrid', 'NZTM2000Quad', 'UPSAntarcticWGS84Quad', 'UPSArcticWGS84Quad', 'UTM31WGS84Quad', 'WGS1984Quad', 'WebMercatorQuad', 'WorldCRS84Quad', 'WorldMercatorWGS84Quad'] -2026-04-21 10:39:37,130 - test_stac_item_tiler - INFO - Number of tile matrices: 13 -2026-04-21 10:39:37,131 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - TEST: test_03_list_available_assets -2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:37,140 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:37,141 - test_stac_item_tiler - INFO - Calling: list_available_assets(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') -2026-04-21 10:39:37,145 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,145 - test_stac_item_tiler - INFO - Response: ['image', 'tilejson'] -2026-04-21 10:39:37,146 - test_stac_item_tiler - INFO - Number of assets: 2 -2026-04-21 10:39:37,146 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - TEST: test_04_get_bounds -2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:37,154 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:37,155 - test_stac_item_tiler - INFO - Calling: list_bounds(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') -2026-04-21 10:39:37,161 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,161 - test_stac_item_tiler - INFO - Response: {'bounds': [-84.44157, 33.621853, -84.370894, 33.690654]} -2026-04-21 10:39:37,162 - test_stac_item_tiler - INFO - Bounds: [-84.44157, 33.621853, -84.370894, 33.690654] -2026-04-21 10:39:37,162 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - TEST: test_05_get_preview -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:37,197 - test_stac_item_tiler - INFO - Input - dimensions: 512x512 -2026-04-21 10:39:37,198 - test_stac_item_tiler - INFO - Calling: get_preview(...) -2026-04-21 10:39:37,203 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,207 - test_stac_item_tiler - INFO - Image size: 714799 bytes -2026-04-21 10:39:37,207 - test_stac_item_tiler - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 -2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - PIL Image format: PNG -2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - PIL Image size: (512, 512) -2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - PIL Image mode: RGBA -2026-04-21 10:39:37,272 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - TEST: test_06_get_info_geo_json -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:37,281 - test_stac_item_tiler - INFO - Calling: get_info_geo_json(...) -2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - Response keys: ['type', 'geometry', 'properties'] -2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - type: -2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - geometry: -2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - properties: -2026-04-21 10:39:37,290 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - TEST: test_07_list_statistics -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:37,308 - test_stac_item_tiler - INFO - Calling: list_statistics(...) -2026-04-21 10:39:37,321 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,321 - test_stac_item_tiler - INFO - Response keys: ['image_b1', 'image_b2', 'image_b3', 'image_b4'] -2026-04-21 10:39:37,321 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - TEST: test_08_get_wmts_capabilities -2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:37,333 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:37,334 - test_stac_item_tiler - INFO - Calling: get_wmts_capabilities(...) -2026-04-21 10:39:37,339 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,339 - test_stac_item_tiler - INFO - XML size: 8462 bytes -2026-04-21 10:39:37,339 - test_stac_item_tiler - INFO - XML first 200 chars: -2026-04-21 10:39:37,861 - test_stac_item_tiler - INFO - Response: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} -2026-04-21 10:39:37,861 - test_stac_item_tiler - INFO - Response dict keys: ['image'] -2026-04-21 10:39:37,861 - test_stac_item_tiler - INFO - Response dict: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} -2026-04-21 10:39:37,880 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,880 - test_stac_item_tiler - INFO - TEST: test_20_list_tilesets -2026-04-21 10:39:37,880 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,920 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,920 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,934 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,934 - test_stac_item_tiler - INFO - TEST: test_21_get_tileset_metadata -2026-04-21 10:39:37,934 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,950 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,951 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:37,961 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,961 - test_stac_item_tiler - INFO - TEST: test_01_get_tile_matrix_definitions -2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - Input - tile_matrix_set_id: WebMercatorQuad -2026-04-21 10:39:37,962 - test_stac_item_tiler - INFO - Calling: get_tile_matrix_definitions(tile_matrix_set_id='WebMercatorQuad') -2026-04-21 10:39:37,990 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:37,991 - test_stac_item_tiler - INFO - Response keys: ['title', 'description', 'keywords', 'id', 'uri', 'orderedAxes', 'crs', 'wellKnownScaleSet', 'boundingBox', 'tileMatrices'] -2026-04-21 10:39:37,991 - test_stac_item_tiler - INFO - Number of tile matrices: 25 -2026-04-21 10:39:37,991 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - TEST: test_02_list_tile_matrices -2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,027 - test_stac_item_tiler - INFO - Calling: list_tile_matrices() -2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Response: ['CDB1GlobalGrid', 'CanadianNAD83_LCC', 'EuropeanETRS89_LAEAQuad', 'GNOSISGlobalGrid', 'LINZAntarticaMapTilegrid', 'NZTM2000Quad', 'UPSAntarcticWGS84Quad', 'UPSArcticWGS84Quad', 'UTM31WGS84Quad', 'WGS1984Quad', 'WebMercatorQuad', 'WorldCRS84Quad', 'WorldMercatorWGS84Quad'] -2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Number of tile matrices: 13 -2026-04-21 10:39:38,033 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,042 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,042 - test_stac_item_tiler - INFO - TEST: test_03_list_available_assets -2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:38,043 - test_stac_item_tiler - INFO - Calling: list_available_assets(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') -2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Response: ['image', 'tilejson'] -2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Number of assets: 2 -2026-04-21 10:39:38,049 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - TEST: test_04_get_bounds -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:38,068 - test_stac_item_tiler - INFO - Calling: list_bounds(collection_id='naip', item_id='ga_m_3308421_se_16_060_20211114') -2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Response: {'bounds': [-84.44157, 33.621853, -84.370894, 33.690654]} -2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Bounds: [-84.44157, 33.621853, -84.370894, 33.690654] -2026-04-21 10:39:38,074 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - TEST: test_05_get_preview -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Input - dimensions: 512x512 -2026-04-21 10:39:38,108 - test_stac_item_tiler - INFO - Calling: get_preview(...) -2026-04-21 10:39:38,114 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - Image size: 714799 bytes -2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - First 16 bytes (hex): 89504e470d0a1a0a0000000d49484452 -2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - PIL Image format: PNG -2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - PIL Image size: (512, 512) -2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - PIL Image mode: RGBA -2026-04-21 10:39:38,118 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - TEST: test_06_get_info_geo_json -2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,127 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,128 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:38,128 - test_stac_item_tiler - INFO - Calling: get_info_geo_json(...) -2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - Response keys: ['type', 'geometry', 'properties'] -2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - type: -2026-04-21 10:39:38,136 - test_stac_item_tiler - INFO - geometry: -2026-04-21 10:39:38,137 - test_stac_item_tiler - INFO - properties: -2026-04-21 10:39:38,137 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,149 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - TEST: test_07_list_statistics -2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:38,150 - test_stac_item_tiler - INFO - Calling: list_statistics(...) -2026-04-21 10:39:38,162 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,163 - test_stac_item_tiler - INFO - Response keys: ['image_b1', 'image_b2', 'image_b3', 'image_b4'] -2026-04-21 10:39:38,163 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - TEST: test_08_get_wmts_capabilities -2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - Input - endpoint: https://Sanitized.sanitized_label.sanitized_location.geocatalog.spatio.azure.com -2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - Input - collection_id: naip -2026-04-21 10:39:38,174 - test_stac_item_tiler - INFO - Input - item_id: ga_m_3308421_se_16_060_20211114 -2026-04-21 10:39:38,175 - test_stac_item_tiler - INFO - Calling: get_wmts_capabilities(...) -2026-04-21 10:39:38,180 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,180 - test_stac_item_tiler - INFO - XML size: 8450 bytes -2026-04-21 10:39:38,181 - test_stac_item_tiler - INFO - XML first 200 chars: -2026-04-21 10:39:38,594 - test_stac_item_tiler - INFO - Response: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} -2026-04-21 10:39:38,594 - test_stac_item_tiler - INFO - Response dict keys: ['image'] -2026-04-21 10:39:38,594 - test_stac_item_tiler - INFO - Response dict: {'image': {'bounds': [-84.44157036219231, 33.62185311275707, -84.37089430625126, 33.690654419926105], 'band_metadata': [['b1', {}], ['b2', {}], ['b3', {}], ['b4', {}]], 'band_descriptions': [['b1', ''], ['b2', ''], ['b3', ''], ['b4', '']], 'dtype': 'uint8', 'nodata_type': 'None', 'colorinterp': ['red', 'green', 'blue', 'undefined'], 'minzoom': 12, 'maxzoom': 18, 'crs': 'http://www.opengis.net/def/crs/EPSG/0/4326', 'driver': 'GTiff', 'count': 4, 'width': 10620, 'height': 12460, 'overviews': [2, 4, 8, 16, 32]}} -2026-04-21 10:39:38,604 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,604 - test_stac_item_tiler - INFO - TEST: test_20_list_tilesets -2026-04-21 10:39:38,604 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,642 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,642 - test_stac_item_tiler - INFO - Test PASSED - -2026-04-21 10:39:38,652 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,652 - test_stac_item_tiler - INFO - TEST: test_21_get_tileset_metadata -2026-04-21 10:39:38,652 - test_stac_item_tiler - INFO - ================================================================================ -2026-04-21 10:39:38,668 - test_stac_item_tiler - INFO - Response type: -2026-04-21 10:39:38,668 - test_stac_item_tiler - INFO - Test PASSED - diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log b/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log deleted file mode 100644 index 245e606b955f..000000000000 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/logs/stac_specification_test_results.log +++ /dev/null @@ -1,9 +0,0 @@ -2026-04-21 20:08:53,785 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 20:08:53,785 - test_planetary_computer_02_stac_specification_async - INFO - TEST: Replace STAC Item -2026-04-21 20:08:53,786 - test_planetary_computer_02_stac_specification_async - INFO - ================================================================================ -2026-04-21 20:08:55,560 - test_planetary_computer_02_stac_specification_async - INFO - Using test item for replace test: ga_m_3308421_se_16_060_20211114_test -2026-04-21 20:08:55,560 - test_planetary_computer_02_stac_specification_async - INFO - Replacing item ga_m_3308421_se_16_060_20211114_test using begin_replace_item... -2026-04-21 20:09:26,039 - test_planetary_computer_02_stac_specification_async - INFO - Replaced item ga_m_3308421_se_16_060_20211114_test -2026-04-21 20:09:26,108 - test_planetary_computer_02_stac_specification_async - INFO - Verified replaced item, platform: Imagery Updated via Replace Test -2026-04-21 20:09:26,924 - test_planetary_computer_02_stac_specification_async - INFO - Restored original item ga_m_3308421_se_16_060_20211114_test -2026-04-21 20:09:26,924 - test_planetary_computer_02_stac_specification_async - INFO - Successfully verified replace operation for item ga_m_3308421_se_16_060_20211114_test diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py index f8e7ca1867d2..6f8002ac7d30 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py @@ -253,7 +253,6 @@ def test_03_get_mosaics_tile_json(self, planetarycomputer_endpoint, planetarycom test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -348,7 +347,7 @@ def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetarycomputer test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Search WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -427,7 +426,6 @@ def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, plan test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_06_get_mosaics_assets_for_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -516,7 +514,6 @@ def test_06_get_mosaics_assets_for_point(self, planetarycomputer_endpoint, plane test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_07_get_mosaics_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -587,7 +584,6 @@ def test_07_get_mosaics_assets_for_tile(self, planetarycomputer_endpoint, planet test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_08_get_searches_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -625,7 +621,7 @@ def test_08_get_searches_point(self, planetarycomputer_endpoint, planetarycomput test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -667,7 +663,6 @@ def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetaryco test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_10_crop_searches_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py index 4b6ec4fbb625..0a5a591a0222 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py @@ -261,7 +261,6 @@ async def test_03_get_mosaics_tile_json(self, planetarycomputer_endpoint, planet await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -358,7 +357,7 @@ async def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetaryco await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Search WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -439,7 +438,6 @@ async def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_06_get_mosaics_assets_for_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -530,7 +528,6 @@ async def test_06_get_mosaics_assets_for_point(self, planetarycomputer_endpoint, await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_07_get_mosaics_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -603,7 +600,6 @@ async def test_07_get_mosaics_assets_for_tile(self, planetarycomputer_endpoint, await self.close_client() - @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_08_get_searches_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -642,7 +638,7 @@ async def test_08_get_searches_point(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -685,7 +681,6 @@ async def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, plane test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_10_crop_searches_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py index cfb2193b993c..97bd730c8367 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py @@ -58,7 +58,6 @@ def test_01_get_collection_info(self, planetarycomputer_endpoint, planetarycompu test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_02_get_collection_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -82,7 +81,6 @@ def test_02_get_collection_point(self, planetarycomputer_endpoint, planetarycomp test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -98,7 +96,6 @@ def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, planet collection_id=planetarycomputer_collection_id, longitude=-84.3860, latitude=33.6760, - assets=["image"], ) test_logger.info(f"Response type: {type(response)}") @@ -106,7 +103,6 @@ def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, planet test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_04_get_collection_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -162,7 +158,7 @@ def test_05_get_collection_tile_json(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -191,7 +187,7 @@ def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE collection lacks default mosaic metadata with assets for WMTS") + @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Collection WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -220,7 +216,6 @@ def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, p test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_08_crop_collection_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -280,7 +275,6 @@ def test_09_list_collection_tilesets(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy def test_10_get_collection_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py index eace707b9ef2..1e3df01141c5 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py @@ -61,7 +61,6 @@ async def test_01_get_collection_info(self, planetarycomputer_endpoint, planetar test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_02_get_collection_point(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -86,7 +85,6 @@ async def test_02_get_collection_point(self, planetarycomputer_endpoint, planeta test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE returns 404; managed storage not accessible for data operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -102,7 +100,6 @@ async def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, collection_id=planetarycomputer_collection_id, longitude=-84.3860, latitude=33.6760, - assets=["image"], ) test_logger.info(f"Response type: {type(response)}") @@ -111,7 +108,6 @@ async def test_03_get_collection_point_assets(self, planetarycomputer_endpoint, test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_04_get_collection_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -169,7 +165,7 @@ async def test_05_get_collection_tile_json(self, planetarycomputer_endpoint, pla test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") + @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -199,7 +195,7 @@ async def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, pla test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE collection lacks default mosaic metadata with assets for WMTS") + @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Collection WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -228,7 +224,6 @@ async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpo test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_08_crop_collection_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -290,7 +285,6 @@ async def test_09_list_collection_tilesets(self, planetarycomputer_endpoint, pla test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tile rendering returns 404; managed storage not accessible for tile operations") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_10_get_collection_assets_for_tile(self, planetarycomputer_endpoint, planetarycomputer_collection_id): From 40e61cbd6eb3ea2b7281ee162dee6687e3e73ba2 Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Wed, 22 Apr 2026 14:52:09 +0100 Subject: [PATCH 6/9] Update assets.json with new recordings --- sdk/planetarycomputer/azure-planetarycomputer/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/assets.json b/sdk/planetarycomputer/azure-planetarycomputer/assets.json index 6496dada6cbd..c63d7d80d39a 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/planetarycomputer/azure-planetarycomputer", - "Tag": "python/planetarycomputer/azure-planetarycomputer_e1b7547c7b" + "Tag": "python/planetarycomputer/azure-planetarycomputer_4f4fec9b90" } From cb0058ca69aadb7767fe432836c68505df82fa60 Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Wed, 22 Apr 2026 15:35:46 +0100 Subject: [PATCH 7/9] Add conftest.py to exclude generated_tests from pytest collection --- sdk/planetarycomputer/azure-planetarycomputer/conftest.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 sdk/planetarycomputer/azure-planetarycomputer/conftest.py diff --git a/sdk/planetarycomputer/azure-planetarycomputer/conftest.py b/sdk/planetarycomputer/azure-planetarycomputer/conftest.py new file mode 100644 index 000000000000..1910a9848d18 --- /dev/null +++ b/sdk/planetarycomputer/azure-planetarycomputer/conftest.py @@ -0,0 +1 @@ +collect_ignore_glob = ["generated_tests/*", "generated_samples/*"] From 3f7f4f4a51b5a93ad84858f6f5d22d7f96e196cd Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Thu, 23 Apr 2026 13:54:31 +0100 Subject: [PATCH 8/9] Regenerate SDK with TypeSpec fixes, enable WMTS/bbox tests, update Python to 3.10, update recordings --- .../azure-planetarycomputer/assets.json | 2 +- .../planetarycomputer/_utils/model_base.py | 219 ++++++++++---- .../aio/operations/_operations.py | 182 +++++++++-- .../operations/_operations.py | 282 ++++++++++++++++-- .../azure-planetarycomputer/pyproject.toml | 3 +- ...etary_computer_04_stac_item_tiler_async.py | 4 +- ...anetary_computer_05_mosaics_tiler_async.py | 2 - .../planetary_computer_05_mosaics_tiler.py | 2 - ...t_planetary_computer_00_stac_collection.py | 1 + ...etary_computer_00_stac_collection_async.py | 2 + ...netary_computer_01_ingestion_management.py | 10 +- ...est_planetary_computer_05_mosaics_tiler.py | 10 +- ...anetary_computer_05_mosaics_tiler_async.py | 10 +- ..._computer_07_collection_lifecycle_async.py | 1 + ..._planetary_computer_08_collection_tiler.py | 13 +- ...tary_computer_08_collection_tiler_async.py | 25 +- .../azure-planetarycomputer/tsp-location.yaml | 2 +- 17 files changed, 608 insertions(+), 162 deletions(-) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/assets.json b/sdk/planetarycomputer/azure-planetarycomputer/assets.json index c63d7d80d39a..5be52877c3a1 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/planetarycomputer/azure-planetarycomputer", - "Tag": "python/planetarycomputer/azure-planetarycomputer_4f4fec9b90" + "Tag": "python/planetarycomputer/azure-planetarycomputer_6c55962364" } diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py index a75a22adbb97..eef4e52ed1a0 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_utils/model_base.py @@ -600,57 +600,9 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: for rest_field in self._attr_to_rest_field.values() if rest_field._default is not _UNSET } - if args: # pylint: disable=too-many-nested-blocks + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -669,6 +621,69 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: ) super().__init__(dict_to_pass) + def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + model_meta = getattr(self, "_xml", {}) + existed_attr_keys: list[str] = [] + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -735,7 +750,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -1208,6 +1223,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1219,10 +1284,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1244,7 +1315,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1256,12 +1329,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1270,6 +1338,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1277,7 +1346,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1286,13 +1355,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1304,8 +1376,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1326,11 +1399,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py index d87e6b15830a..c9679a333f70 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/aio/operations/_operations.py @@ -6199,32 +6199,18 @@ async def get_interval_legend( Generate values and color swatches mapping for a given interval classmap. - Returns a color map for intervals, where each interval is defined by: - - * A numeric range `[min, max]` representing the interval boundaries. - * An RGBA color `[red, green, blue, alpha]` associated with the interval. + Returns a color map for intervals, where each interval is defined by + a numeric range [min, max] representing the interval boundaries and + an RGBA color [red, green, blue, alpha] associated with the interval. The response is a 2D array of interval definitions, where each element is a pair: - - * The first element is an array of two numbers `[min, max]` defining the interval. - * The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA + the first element is an array of two numbers [min, max] defining the interval, + and the second element is an array of four numbers [red, green, blue, alpha] defining the RGBA color. - Example: - - .. code-block:: json - - [ - [ - [-2, 0], [0, 0, 0, 0] - ], - [ - [1, 32], [255, 255, 178, 255] - ] - ]This example defines two intervals: - - * The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black). - * The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow). + Example: [[ [-2, 0], [0, 0, 0, 0] ], [ [1, 32], [255, 255, 178, 255] ]]. + This defines two intervals: [-2, 0] mapped to transparent black and [1, 32] mapped to opaque + yellow. :param classmap_name: classmap name. Required. :type classmap_name: str @@ -18043,7 +18029,7 @@ async def get_collection_tile_json_tms( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace_async - async def get_collection_wmts_capabilities( + async def get_collection_wmts_capabilities( # pylint: disable=too-many-locals self, collection_id: str, *, @@ -18057,6 +18043,14 @@ async def get_collection_wmts_capabilities( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: """Collection Wmts. @@ -18093,6 +18087,26 @@ async def get_collection_wmts_capabilities( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -18122,6 +18136,14 @@ async def get_collection_wmts_capabilities( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, @@ -18159,7 +18181,7 @@ async def get_collection_wmts_capabilities( return deserialized # type: ignore @distributed_trace_async - async def get_collection_wmts_capabilities_tms( + async def get_collection_wmts_capabilities_tms( # pylint: disable=too-many-locals self, collection_id: str, tile_matrix_set_id: str, @@ -18173,6 +18195,14 @@ async def get_collection_wmts_capabilities_tms( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: """Collection Wmts Tilematrixsetid As Path. @@ -18204,6 +18234,26 @@ async def get_collection_wmts_capabilities_tms( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -18233,6 +18283,14 @@ async def get_collection_wmts_capabilities_tms( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, @@ -24265,7 +24323,7 @@ async def get_searches_tile_json_tms( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace_async - async def get_searches_wmts_capabilities_tms( + async def get_searches_wmts_capabilities_tms( # pylint: disable=too-many-locals self, search_id: str, tile_matrix_set_id: str, @@ -24274,6 +24332,14 @@ async def get_searches_wmts_capabilities_tms( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: """Searches Wmts Tilematrixsetid As Path. @@ -24294,6 +24360,26 @@ async def get_searches_wmts_capabilities_tms( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -24318,6 +24404,14 @@ async def get_searches_wmts_capabilities_tms( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, @@ -27682,7 +27776,7 @@ async def crop_searches_feature_geo_json_width_by_height( # pylint: disable=nam return deserialized # type: ignore @distributed_trace_async - async def get_searches_wmts_capabilities( + async def get_searches_wmts_capabilities( # pylint: disable=too-many-locals self, search_id: str, *, @@ -27691,6 +27785,14 @@ async def get_searches_wmts_capabilities( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: """Searches Wmts. @@ -27716,6 +27818,26 @@ async def get_searches_wmts_capabilities( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: AsyncIterator[bytes] :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -27740,6 +27862,14 @@ async def get_searches_wmts_capabilities( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py index 55fba35d4ab4..15eea67acc22 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py @@ -6242,7 +6242,7 @@ def build_data_get_collection_tile_json_tms_request( # pylint: disable=name-too return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_collection_wmts_capabilities_request( # pylint: disable=name-too-long +def build_data_get_collection_wmts_capabilities_request( # pylint: disable=name-too-long,too-many-locals collection_id: str, *, ids: Optional[str] = None, @@ -6255,6 +6255,14 @@ def build_data_get_collection_wmts_capabilities_request( # pylint: disable=name tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6293,6 +6301,22 @@ def build_data_get_collection_wmts_capabilities_request( # pylint: disable=name _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") if max_zoom is not None: _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -6300,7 +6324,7 @@ def build_data_get_collection_wmts_capabilities_request( # pylint: disable=name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_collection_wmts_capabilities_tms_request( # pylint: disable=name-too-long +def build_data_get_collection_wmts_capabilities_tms_request( # pylint: disable=name-too-long,too-many-locals collection_id: str, tile_matrix_set_id: str, *, @@ -6313,6 +6337,14 @@ def build_data_get_collection_wmts_capabilities_tms_request( # pylint: disable= tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6350,6 +6382,22 @@ def build_data_get_collection_wmts_capabilities_tms_request( # pylint: disable= _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") if max_zoom is not None: _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -8431,6 +8479,14 @@ def build_data_get_searches_wmts_capabilities_tms_request( # pylint: disable=na tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -8458,6 +8514,22 @@ def build_data_get_searches_wmts_capabilities_tms_request( # pylint: disable=na _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") if max_zoom is not None: _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -9259,6 +9331,14 @@ def build_data_get_searches_wmts_capabilities_request( # pylint: disable=name-t tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -9287,6 +9367,22 @@ def build_data_get_searches_wmts_capabilities_request( # pylint: disable=name-t _params["minzoom"] = _SERIALIZER.query("min_zoom", min_zoom, "int") if max_zoom is not None: _params["maxzoom"] = _SERIALIZER.query("max_zoom", max_zoom, "int") + if bidx is not None: + _params["bidx"] = [_SERIALIZER.query("bidx", q, "int") if q is not None else "" for q in bidx] + if assets is not None: + _params["assets"] = [_SERIALIZER.query("assets", q, "str") if q is not None else "" for q in assets] + if expression is not None: + _params["expression"] = _SERIALIZER.query("expression", expression, "str") + if asset_band_indices is not None: + _params["asset_bidx"] = _SERIALIZER.query("asset_band_indices", asset_band_indices, "[str]", div=",") + if asset_as_band is not None: + _params["asset_as_band"] = _SERIALIZER.query("asset_as_band", asset_as_band, "bool") + if no_data is not None: + _params["nodata"] = _SERIALIZER.query("no_data", no_data, "str") + if unscale is not None: + _params["unscale"] = _SERIALIZER.query("unscale", unscale, "bool") + if reproject is not None: + _params["reproject"] = _SERIALIZER.query("reproject", reproject, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -16285,32 +16381,18 @@ def get_interval_legend( Generate values and color swatches mapping for a given interval classmap. - Returns a color map for intervals, where each interval is defined by: - - * A numeric range `[min, max]` representing the interval boundaries. - * An RGBA color `[red, green, blue, alpha]` associated with the interval. + Returns a color map for intervals, where each interval is defined by + a numeric range [min, max] representing the interval boundaries and + an RGBA color [red, green, blue, alpha] associated with the interval. The response is a 2D array of interval definitions, where each element is a pair: - - * The first element is an array of two numbers `[min, max]` defining the interval. - * The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA + the first element is an array of two numbers [min, max] defining the interval, + and the second element is an array of four numbers [red, green, blue, alpha] defining the RGBA color. - Example: - - .. code-block:: json - - [ - [ - [-2, 0], [0, 0, 0, 0] - ], - [ - [1, 32], [255, 255, 178, 255] - ] - ]This example defines two intervals: - - * The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black). - * The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow). + Example: [[ [-2, 0], [0, 0, 0, 0] ], [ [1, 32], [255, 255, 178, 255] ]]. + This defines two intervals: [-2, 0] mapped to transparent black and [1, 32] mapped to opaque + yellow. :param classmap_name: classmap name. Required. :type classmap_name: str @@ -28129,7 +28211,7 @@ def get_collection_tile_json_tms( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace - def get_collection_wmts_capabilities( + def get_collection_wmts_capabilities( # pylint: disable=too-many-locals self, collection_id: str, *, @@ -28143,6 +28225,14 @@ def get_collection_wmts_capabilities( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> Iterator[bytes]: """Collection Wmts. @@ -28179,6 +28269,26 @@ def get_collection_wmts_capabilities( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -28208,6 +28318,14 @@ def get_collection_wmts_capabilities( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, @@ -28245,7 +28363,7 @@ def get_collection_wmts_capabilities( return deserialized # type: ignore @distributed_trace - def get_collection_wmts_capabilities_tms( + def get_collection_wmts_capabilities_tms( # pylint: disable=too-many-locals self, collection_id: str, tile_matrix_set_id: str, @@ -28259,6 +28377,14 @@ def get_collection_wmts_capabilities_tms( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> Iterator[bytes]: """Collection Wmts Tilematrixsetid As Path. @@ -28290,6 +28416,26 @@ def get_collection_wmts_capabilities_tms( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -28319,6 +28465,14 @@ def get_collection_wmts_capabilities_tms( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, @@ -34351,7 +34505,7 @@ def get_searches_tile_json_tms( # pylint: disable=too-many-locals return deserialized # type: ignore @distributed_trace - def get_searches_wmts_capabilities_tms( + def get_searches_wmts_capabilities_tms( # pylint: disable=too-many-locals self, search_id: str, tile_matrix_set_id: str, @@ -34360,6 +34514,14 @@ def get_searches_wmts_capabilities_tms( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> Iterator[bytes]: """Searches Wmts Tilematrixsetid As Path. @@ -34380,6 +34542,26 @@ def get_searches_wmts_capabilities_tms( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -34404,6 +34586,14 @@ def get_searches_wmts_capabilities_tms( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, @@ -37768,7 +37958,7 @@ def crop_searches_feature_geo_json_width_by_height( # pylint: disable=name-too- return deserialized # type: ignore @distributed_trace - def get_searches_wmts_capabilities( + def get_searches_wmts_capabilities( # pylint: disable=too-many-locals self, search_id: str, *, @@ -37777,6 +37967,14 @@ def get_searches_wmts_capabilities( tile_scale: Optional[int] = None, min_zoom: Optional[int] = None, max_zoom: Optional[int] = None, + bidx: Optional[List[int]] = None, + assets: Optional[List[str]] = None, + expression: Optional[str] = None, + asset_band_indices: Optional[List[str]] = None, + asset_as_band: Optional[bool] = None, + no_data: Optional[str] = None, + unscale: Optional[bool] = None, + reproject: Optional[Union[str, _models.WarpKernelResampling]] = None, **kwargs: Any ) -> Iterator[bytes]: """Searches Wmts. @@ -37802,6 +38000,26 @@ def get_searches_wmts_capabilities( :paramtype min_zoom: int :keyword max_zoom: Overwrite default maxzoom. Default value is None. :paramtype max_zoom: int + :keyword bidx: Dataset band indexes. Default value is None. + :paramtype bidx: list[int] + :keyword assets: Asset's names. Default value is None. + :paramtype assets: list[str] + :keyword expression: Band math expression between assets. Default value is None. + :paramtype expression: str + :keyword asset_band_indices: Per asset band indexes (coma separated indexes, e.g. "image|1,2,3" + means use the bands 1, 2, and 3 from the asset named "image"). Default value is None. + :paramtype asset_band_indices: list[str] + :keyword asset_as_band: Asset as Band. Default value is None. + :paramtype asset_as_band: bool + :keyword no_data: Overwrite internal Nodata value. Default value is None. + :paramtype no_data: str + :keyword unscale: Apply internal Scale or Offset. Default value is None. + :paramtype unscale: bool + :keyword reproject: WarpKernel resampling algorithm (only used when doing re-projection). + Defaults to ``nearest``. Known values are: "nearest", "bilinear", "cubic", "cubic_spline", + "lanczos", "average", "mode", "max", "min", "med", "q1", "q3", "sum", and "rms". Default value + is None. + :paramtype reproject: str or ~azure.planetarycomputer.models.WarpKernelResampling :return: Iterator[bytes] :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: @@ -37826,6 +38044,14 @@ def get_searches_wmts_capabilities( tile_scale=tile_scale, min_zoom=min_zoom, max_zoom=max_zoom, + bidx=bidx, + assets=assets, + expression=expression, + asset_band_indices=asset_band_indices, + asset_as_band=asset_as_band, + no_data=no_data, + unscale=unscale, + reproject=reproject, api_version=self._config.api_version, headers=_headers, params=_params, diff --git a/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml b/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml index 2ddac642faa9..2a2a2242afe2 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml +++ b/sdk/planetarycomputer/azure-planetarycomputer/pyproject.toml @@ -21,13 +21,12 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = ["azure", "azure sdk"] dependencies = [ diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py index aaa411439bdc..26e59b93ec0f 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_04_stac_item_tiler_async.py @@ -80,9 +80,7 @@ async def get_item_asset_details(client: PlanetaryComputerProClient, collection_ """ # Get info for specific assets - result_specific = await client.data.get_item_info( - collection_id=collection_id, item_id=item_id, assets=["image"] - ) + result_specific = await client.data.get_item_info(collection_id=collection_id, item_id=item_id, assets=["image"]) logging.info("Assets info (image asset only):") logging.info(f" Dataset: {result_specific}") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py index f5f8d9cfe411..aab5afe3e7fb 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/async/planetary_computer_05_mosaics_tiler_async.py @@ -27,8 +27,6 @@ StacSortExtension, StacSearchSortingDirection, TilerImageFormat, - - ) import logging diff --git a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py index 6c1470affac8..3d6325482a61 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/samples/planetary_computer_05_mosaics_tiler.py @@ -26,8 +26,6 @@ StacSortExtension, StacSearchSortingDirection, TilerImageFormat, - - ) import logging diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py index 33e43ef46f96..f587c4d02618 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection.py @@ -919,6 +919,7 @@ def test_18_replace_partition_type(self, planetarycomputer_endpoint): # Create the collection, retrying if previous deletion hasn't fully propagated from azure.core.exceptions import ResourceExistsError + test_logger.info("Creating collection using begin_create_collection") for attempt in range(12): try: diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py index 91e078e6c72f..58d1055ba17b 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_00_stac_collection_async.py @@ -934,6 +934,7 @@ async def test_18_replace_partition_type(self, planetarycomputer_endpoint): test_logger.info(f"Deleted existing collection '{test_collection_id}'") # Wait for deletion to fully propagate import asyncio + for _ in range(12): try: await client.stac.get_collection(collection_id=test_collection_id) @@ -971,6 +972,7 @@ async def test_18_replace_partition_type(self, planetarycomputer_endpoint): # Create the collection, retrying if previous deletion hasn't fully propagated import asyncio from azure.core.exceptions import ResourceExistsError + test_logger.info("Creating collection using begin_create_collection") for attempt in range(12): try: diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py index f3d6452b8916..f15f18244f88 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_01_ingestion_management.py @@ -199,10 +199,12 @@ def test_03_create_ingestion_definition(self, planetarycomputer_endpoint, planet for ingestion in existing_ingestions: # Cancel any active runs before deleting try: - runs = list(client.ingestion.list_runs( - collection_id=planetarycomputer_collection_id, - ingestion_id=ingestion.id, - )) + runs = list( + client.ingestion.list_runs( + collection_id=planetarycomputer_collection_id, + ingestion_id=ingestion.id, + ) + ) for run in runs: run_status = run.status if hasattr(run, "status") else run.get("status", "") if run_status in ("Running", "Pending", "Queued"): diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py index 6f8002ac7d30..82e1044bb33c 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler.py @@ -347,7 +347,6 @@ def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetarycomputer test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Search WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -621,7 +620,6 @@ def test_08_get_searches_point(self, planetarycomputer_endpoint, planetarycomput test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -648,10 +646,10 @@ def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetaryco response = client.data.get_searches_bbox_crop( search_id=search_id, - minx=-84.3930, - miny=33.6798, - maxx=-84.3670, - maxy=33.7058, + minx=-84.3900, + miny=33.6800, + maxx=-84.3850, + maxy=33.6850, format="png", assets=["image"], asset_band_indices=["image|1,2,3"], diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py index 0a5a591a0222..3fe91a94f97c 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_05_mosaics_tiler_async.py @@ -357,7 +357,6 @@ async def test_04_get_mosaics_tile(self, planetarycomputer_endpoint, planetaryco await self.close_client() - @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Search WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_05_get_mosaics_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -638,7 +637,6 @@ async def test_08_get_searches_point(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -665,10 +663,10 @@ async def test_09_get_searches_bbox_crop(self, planetarycomputer_endpoint, plane response = await client.data.get_searches_bbox_crop( search_id=search_id, - minx=-84.3930, - miny=33.6798, - maxx=-84.3670, - maxy=33.7058, + minx=-84.3900, + miny=33.6800, + maxx=-84.3850, + maxy=33.6850, format="png", assets=["image"], asset_band_indices=["image|1,2,3"], diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py index 19fe7b6dbfa0..3f1d8492b473 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_07_collection_lifecycle_async.py @@ -89,6 +89,7 @@ async def test_01_begin_create_collection(self, planetarycomputer_endpoint): test_logger.info("Calling: begin_create_collection(body=collection_data)") import asyncio from azure.core.exceptions import ResourceExistsError + for attempt in range(12): try: create_poller = await client.stac.begin_create_collection(body=collection_data, polling=True) diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py index 97bd730c8367..e76cd7c2ff63 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler.py @@ -158,7 +158,6 @@ def test_05_get_collection_tile_json(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -171,10 +170,10 @@ def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetary response = client.data.get_collection_bbox_crop( collection_id=planetarycomputer_collection_id, - minx=-84.3930, - miny=33.6798, - maxx=-84.3670, - maxy=33.7058, + minx=-84.3900, + miny=33.6800, + maxx=-84.3850, + maxy=33.6850, format="png", assets=["image"], asset_band_indices=["image|1,2,3"], @@ -187,7 +186,6 @@ def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetary test_logger.info("Test PASSED\n") - @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Collection WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -200,6 +198,7 @@ def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, p response = client.data.get_collection_wmts_capabilities( collection_id=planetarycomputer_collection_id, + assets=["image"], ) test_logger.info(f"Response type: {type(response)}") @@ -209,7 +208,7 @@ def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, p if isinstance(response, bytes): assert b"WMTSCapabilities" in response or b"xml" in response test_logger.info(f"Response size: {len(response)} bytes") - elif hasattr(response, '__iter__'): + elif hasattr(response, "__iter__"): xml_bytes = b"".join(response) test_logger.info(f"Response size: {len(xml_bytes)} bytes") assert len(xml_bytes) > 0 diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py index 1e3df01141c5..e5cfbfe585c3 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_08_collection_tiler_async.py @@ -165,7 +165,6 @@ async def test_05_get_collection_tile_json(self, planetarycomputer_endpoint, pla test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="PPE tiler returns 503 Service Unavailable for bbox crop rendering") @PlanetaryComputerPreparer() @recorded_by_proxy_async async def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, planetarycomputer_collection_id): @@ -178,10 +177,10 @@ async def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, pla response = await client.data.get_collection_bbox_crop( collection_id=planetarycomputer_collection_id, - minx=-84.3930, - miny=33.6798, - maxx=-84.3670, - maxy=33.7058, + minx=-84.3900, + miny=33.6800, + maxx=-84.3850, + maxy=33.6850, format="png", assets=["image"], asset_band_indices=["image|1,2,3"], @@ -195,10 +194,11 @@ async def test_06_get_collection_bbox_crop(self, planetarycomputer_endpoint, pla test_logger.info("Test PASSED\n") await self.close_client() - @pytest.mark.skip(reason="TypeSpec missing AssetQueryParameters for Collection WMTS; assets param not in SDK method") @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + async def test_07_get_collection_wmts_capabilities( + self, planetarycomputer_endpoint, planetarycomputer_collection_id + ): """Test getting WMTS capabilities for a collection.""" test_logger.info("=" * 80) test_logger.info("TEST: test_07_get_collection_wmts_capabilities") @@ -208,6 +208,7 @@ async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpo response = await client.data.get_collection_wmts_capabilities( collection_id=planetarycomputer_collection_id, + assets=["image"], ) test_logger.info(f"Response type: {type(response)}") @@ -216,7 +217,7 @@ async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpo if isinstance(response, bytes): assert b"WMTSCapabilities" in response or b"xml" in response test_logger.info(f"Response size: {len(response)} bytes") - elif hasattr(response, '__aiter__'): + elif hasattr(response, "__aiter__"): xml_bytes = b"".join([chunk async for chunk in response]) test_logger.info(f"Response size: {len(xml_bytes)} bytes") assert len(xml_bytes) > 0 @@ -226,7 +227,9 @@ async def test_07_get_collection_wmts_capabilities(self, planetarycomputer_endpo @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_08_crop_collection_feature_geo_json(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + async def test_08_crop_collection_feature_geo_json( + self, planetarycomputer_endpoint, planetarycomputer_collection_id + ): """Test cropping a collection by GeoJSON feature.""" test_logger.info("=" * 80) test_logger.info("TEST: test_08_crop_collection_feature_geo_json") @@ -311,7 +314,9 @@ async def test_10_get_collection_assets_for_tile(self, planetarycomputer_endpoin @PlanetaryComputerPreparer() @recorded_by_proxy_async - async def test_11_get_collection_tileset_metadata(self, planetarycomputer_endpoint, planetarycomputer_collection_id): + async def test_11_get_collection_tileset_metadata( + self, planetarycomputer_endpoint, planetarycomputer_collection_id + ): """Test getting collection tileset metadata.""" test_logger.info("=" * 80) test_logger.info("TEST: test_11_get_collection_tileset_metadata") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml b/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml index d37be9986c2c..23a70733579a 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml +++ b/sdk/planetarycomputer/azure-planetarycomputer/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/orbital/Microsoft.PlanetaryComputer -commit: 7cb1cb2dee9bf64f5599d6a40ffad6bf510a71df +commit: 7013d71d09237a0698cd8d2ec86d189afba10595 repo: Azure/azure-rest-api-specs additionalDirectories: From e7d48f764cdee7d181aff8333d159dff4ccba24b Mon Sep 17 00:00:00 2001 From: karthick-rn Date: Thu, 23 Apr 2026 21:24:41 +0100 Subject: [PATCH 9/9] Fix CI checks and SAS test reliability --- .vscode/cspell.json | 2 + .../azure-planetarycomputer/assets.json | 2 +- .../operations/_operations.py | 7 +++- .../tests/test_planetary_computer_03_sas.py | 37 ++++++++++++++++-- .../test_planetary_computer_03_sas_async.py | 39 ++++++++++++++++--- shared_requirements.txt | 2 + 6 files changed, 76 insertions(+), 13 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index f143810da8e8..97fe44712c12 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -2200,6 +2200,8 @@ { "filename": "sdk/planetarycomputer/azure-planetarycomputer/**", "words": ["topo", "haline", "Aproperty"] + }, + { "filename": "sdk/agentserver/azure-ai-agentserver-githubcopilot/**", "words": ["RAPI", "BYOK", "byok", "NCUS", "ncusacr", "fstring", "ename", "valeriepham", "coreai", "Vnext", "PYTHONIOENCODING"] } diff --git a/sdk/planetarycomputer/azure-planetarycomputer/assets.json b/sdk/planetarycomputer/azure-planetarycomputer/assets.json index 5be52877c3a1..db79ee77c2af 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/azure-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/planetarycomputer/azure-planetarycomputer", - "Tag": "python/planetarycomputer/azure-planetarycomputer_6c55962364" + "Tag": "python/planetarycomputer/azure-planetarycomputer_52337a546c" } diff --git a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py index 15eea67acc22..fd1f753b467e 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/operations/_operations.py @@ -33,7 +33,9 @@ from .. import models as _models from .._configuration import PlanetaryComputerProClientConfiguration -from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _deserialize_xml +# TODO: Remove pylint disable once pygen emitter fixes unused _deserialize_xml import +# https://github.com/Azure/autorest.python/issues/XXXX +from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _deserialize_xml # pylint: disable=unused-import from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prepare_multipart_form_data @@ -10143,7 +10145,8 @@ def build_data_get_searches_assets_for_tile_no_tms_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_data_get_searches_point_request( # pylint: disable=too-many-locals +# TODO: Remove pylint disable once pygen emitter generates fewer statements in request builders +def build_data_get_searches_point_request( # pylint: disable=too-many-locals,too-many-statements search_id: str, longitude: float, latitude: float, diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py index fcdd3b562e0e..cd46fb591f87 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas.py @@ -232,6 +232,12 @@ def test_04_signed_href_can_download_asset(self, planetarycomputer_endpoint, pla client = self.create_client(endpoint=planetarycomputer_endpoint) + # Revoke any cached delegation keys to ensure a fresh key is used. + # This is necessary when an ingestion source has been renewed, as the + # server may cache a stale delegation key from the previous source. + test_logger.info("Revoking cached delegation keys...") + client.sas.revoke_token() + test_logger.info("Getting collection...") collection = client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert "thumbnail" in collection.assets, "Collection does not have a thumbnail asset" @@ -289,9 +295,23 @@ def test_05_revoke_token(self, planetarycomputer_endpoint, planetarycomputer_col client = self.create_client(endpoint=planetarycomputer_endpoint) - # Generate a SAS token first + # Generate a SAS token first, with retry for transient PPE 503 errors + import time + test_logger.info("Step 1: Generating SAS token...") - token_response = client.sas.get_token(collection_id=planetarycomputer_collection_id, duration_in_minutes=60) + max_retries = 3 + for attempt in range(max_retries): + try: + token_response = client.sas.get_token( + collection_id=planetarycomputer_collection_id, duration_in_minutes=60 + ) + break + except Exception as e: + if attempt < max_retries - 1: + test_logger.info(f"Attempt {attempt + 1} failed: {e}, retrying in 10s...") + time.sleep(10) + else: + raise test_logger.info(f"Token generated: {token_response.token[:50]}...") assert token_response is not None, "Token response should not be None" @@ -299,9 +319,18 @@ def test_05_revoke_token(self, planetarycomputer_endpoint, planetarycomputer_col token_response, SharedAccessSignatureToken ), f"Response should be SharedAccessSignatureToken, got {type(token_response)}" - # Revoke the token + # Revoke the token, with retry for transient PPE 503 errors test_logger.info("Step 2: Revoking token...") - client.sas.revoke_token() + for attempt in range(max_retries): + try: + client.sas.revoke_token() + break + except Exception as e: + if attempt < max_retries - 1: + test_logger.info(f"Attempt {attempt + 1} failed: {e}, retrying in 10s...") + time.sleep(10) + else: + raise test_logger.info("Token revoked successfully (no exception thrown)") test_logger.info("Test PASSED\n") diff --git a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py index c087a97b1ca1..5ac1ba384d18 100644 --- a/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py +++ b/sdk/planetarycomputer/azure-planetarycomputer/tests/test_planetary_computer_03_sas_async.py @@ -244,6 +244,12 @@ async def test_04_signed_href_can_download_asset(self, planetarycomputer_endpoin client = self.create_client(endpoint=planetarycomputer_endpoint) + # Revoke any cached delegation keys to ensure a fresh key is used. + # This is necessary when an ingestion source has been renewed, as the + # server may cache a stale delegation key from the previous source. + test_logger.info("Revoking cached delegation keys...") + await client.sas.revoke_token() + test_logger.info("Getting collection...") collection = await client.stac.get_collection(collection_id=planetarycomputer_collection_id) assert "thumbnail" in collection.assets, "Collection does not have a thumbnail asset" @@ -303,11 +309,23 @@ async def test_05_revoke_token(self, planetarycomputer_endpoint, planetarycomput client = self.create_client(endpoint=planetarycomputer_endpoint) - # Generate a SAS token first + # Generate a SAS token first, with retry for transient PPE 503 errors + import time + test_logger.info("Step 1: Generating SAS token...") - token_response = await client.sas.get_token( - collection_id=planetarycomputer_collection_id, duration_in_minutes=60 - ) + max_retries = 3 + for attempt in range(max_retries): + try: + token_response = await client.sas.get_token( + collection_id=planetarycomputer_collection_id, duration_in_minutes=60 + ) + break + except Exception as e: + if attempt < max_retries - 1: + test_logger.info(f"Attempt {attempt + 1} failed: {e}, retrying in 10s...") + time.sleep(10) + else: + raise test_logger.info(f"Token generated: {token_response.token[:50]}...") assert token_response is not None, "Token response should not be None" @@ -315,9 +333,18 @@ async def test_05_revoke_token(self, planetarycomputer_endpoint, planetarycomput token_response, SharedAccessSignatureToken ), f"Response should be SharedAccessSignatureToken, got {type(token_response)}" - # Revoke the token + # Revoke the token, with retry for transient PPE 503 errors test_logger.info("Step 2: Revoking token...") - await client.sas.revoke_token() + for attempt in range(max_retries): + try: + await client.sas.revoke_token() + break + except Exception as e: + if attempt < max_retries - 1: + test_logger.info(f"Attempt {attempt + 1} failed: {e}, retrying in 10s...") + time.sleep(10) + else: + raise test_logger.info("Token revoked successfully (no exception thrown)") test_logger.info("Test PASSED\n") diff --git a/shared_requirements.txt b/shared_requirements.txt index 767957e0ecf6..3f8213d2e188 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -100,3 +100,5 @@ langchain-openai azure-ai-language-questionanswering github-copilot-sdk hypercorn +pystac +geojson