Hello!
I am exploring the possibility of using Cesium Ion and Amazon S3 to store 3D files like GeoTIFF and LAZ data. My plan is to display these files in 3D and also use the REST API to fetch terrain data stored as assets in a Python script for geospatial analysis.
I attempted to implement this using the following code:
python
def fetch_tile(asset_id, access_token):
headers = {
'Authorization': f'Bearer {CESIUM_ION_ACCESS_TOKEN}'
}
url = f'{BASE_URL}/{CESIUM_ION_ASSET_ID}/endpoint'
response = requests.get(url, headers=headers)
if response.status_code != 200:
raise Exception(f'Failed to fetch tile: {response.text}')
r = response.json()
url = r['url']
access_token = r['accessToken']
headers = {
'Authorization': f'Bearer {access_token}'
}
response = requests.get(url, headers=headers)
response.raise_for_status()
return BytesIO(response.content)
However, I am encountering a 404 Client Error: Not Found for URL
when I run this code. Is it possible to fetch data from Cesium Ion and read it inside a Python script using Geopandas for geospatial analysis? If so, could you provide guidance on how to correct my approach?
Thank you!