dz1-spatial-query/del_items.py
weixin_46229132 5bc6302955 first commit
2025-07-03 20:29:02 +08:00

16 lines
407 B
Python

import requests
STAC_API_URL = "http://localhost:8082"
COLLECTION_ID = "geosat1"
def delete_item(item_id):
url = f"{STAC_API_URL}/collections/{COLLECTION_ID}/items/{item_id}"
r = requests.delete(url)
if r.status_code in [200, 204]:
print(f"✅ 已成功删除: {item_id}")
else:
print(f"❌ 删除失败: {item_id} | {r.status_code} - {r.text}")
delete_item("TCI_right")