Preview imagery#

Get bounded previews and georeferenced windows of a catalog record. The service reads the raster; you pass only a collection and record ID.

Prerequisites#

Steps#

  1. Inspect the record to see its assets and how pixels map to the ground:

    info = client.media.inspect("preview-imagery", "preview-coast-001")
    

    REST: GET /v1/media/records/{collection}/{record_id}/inspect.

  2. Render a preview:

    preview = client.media.preview(
        "preview-imagery", "preview-coast-001", max_width=768, max_height=768
    )
    open("preview.jpg", "wb").write(preview.content)
    

    REST: GET .../preview?max_width=768&max_height=768. Optional bands, stretch (percentile, minmax, none) and asset.

  3. Render a pixel window of a georeferenced record:

    window = client.media.georeferenced_window(
        "preview-imagery", "preview-coast-001", x=0, y=0, width=512, height=512
    )
    

    REST: GET .../georeferenced-window?x=0&y=0&width=512&height=512. The window is at most 4096 pixels on a side; output_width and output_height resample it. A record without georeferencing returns 422 (ServicesValidationError), as the local stack’s seeded PNG does.

Result#

Each call returns MediaContent with content, media_type, byte_size and a sha256 you can check. Calls take a max_bytes limit. More calls: tile, pixel, histogram, download and product_manifest. See Media API.