Skip to content

Conversation

@gadomski
Copy link
Member

@gadomski gadomski commented Feb 7, 2025

This gets us s3 capabilities, e.g. in a test.py:

import asyncio

import stacrs


async def main():
    print(
        await stacrs.search(
            "s3://stac-fastapi-geoparquet-devseed/naip.parquet", max_items=1
        )
    )


asyncio.run(main())

Then:

$ export AWS_PROFILE=<your-profile>
$ python test.py
[{'type': 'Feature', 'stac_version': '1.1.0', 'stac_extensions': ['https://stac-extensions.github.io/eo/v1.0.0/schema.json', 'https://stac-extensions.github.io/projection/v1.0.0/schema.json'], 'id': 'ne_m_4110264_sw_13_060_20220827', 'geometry': {'type': 'Polygon', 'coordinates': [[[-102.058621, 40.995619], [-102.055505, 41.065536], [-102.128375, 41.067376], [-102.131414, 40.997455], [-102.058621, 40.995619]]]}, 'bbox': [-102.131414, 40.995619, -102.055505, 41.067376], 'links': [{'href': 'https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip', 'rel': 'collection', 'type': 'application/json'}, {'href': 'https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip', 'rel': 'parent', 'type': 'application/json'}, {'href': 'https://planetarycomputer.microsoft.com/api/stac/v1', 'rel': 'root', 'type': 'application/json', 'title': 'Microsoft Planetary Computer STAC API'}, {'href': 'https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ne_m_4110264_sw_13_060_20220827', 'rel': 'self', 'type': 'application/geo+json'}, {'href': 'https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ne_m_4110264_sw_13_060_20220827', 'rel': 'preview', 'type': 'text/html', 'title': 'Map of item'}], 'assets': {'tilejson': {'href': 'https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ne_m_4110264_sw_13_060_20220827&assets=image&asset_bidx=image%7C1%2C2%2C3&format=png', 'title': 'TileJSON 
with default rendering', 'type': 'application/json', 'roles': ['tiles']}, 'rendered_preview': {'href': 'https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ne_m_4110264_sw_13_060_20220827&assets=image&asset_bidx=image%7C1%2C2%2C3&format=png', 'title': 'Rendered preview', 'type': 'image/png', 'roles': ['overview'], 'rel': 'preview'}, 'thumbnail': {'href': 'https://naipeuwest.blob.core.windows.net/naip/v002/ne/2022/ne_060cm_2022/41102/m_4110264_sw_13_060_20220827.200.jpg', 'title': 'Thumbnail', 'type': 'image/jpeg', 'roles': ['thumbnail']}, 'image': {'href': 'https://naipeuwest.blob.core.windows.net/naip/v002/ne/2022/ne_060cm_2022/41102/m_4110264_sw_13_060_20220827.tif', 'title': 'RGBIR COG tile', 'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'eo:bands': [{'name': 'Red', 'common_name': 'red'}, {'name': 'Green', 'common_name': 'green'}, {'name': 'Blue', 'common_name': 'blue'}, {'name': 'NIR', 'common_name': 'nir', 'description': 'near-infrared'}]}}, 'collection': 'naip', 'properties': {'proj:shape': [12953, 10217], 'naip:state': 'ne', 'datetime': '2022-08-27T10:00:00-06:00', 'proj:transform': [0.6, 0.0, 741276.0, 0.0, -0.6, 4550210.4, 0.0, 0.0, 1.0], 'proj:centroid': {'lat': 41.0315, 'lon': -102.09348}, 'gsd': 0.6, 'naip:year': '2022', 'proj:bbox': [741276.0, 4542438.600000001, 747406.2, 4550210.4], 'proj:epsg': 26913, 'providers': [{'url': 'https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/', 'name': 'USDA Farm Service Agency', 'roles': ['producer', 'licensor']}]}}]

cc @hrodmn

@gadomski gadomski self-assigned this Feb 7, 2025
@gadomski gadomski enabled auto-merge (squash) February 7, 2025 15:45
@gadomski gadomski merged commit b9fa9e3 into main Feb 7, 2025
2 checks passed
@gadomski gadomski deleted the update-duckdb branch February 7, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants