Skip to content

3D coordinates not supported for bbox search parameter #808

@vprivat-ads

Description

@vprivat-ads

STAC item-search API explicitly allows 3D coordinates for bbox search parameter:

bbox Represented using either 2D or 3D geometries. The length of the array must be 2*n where n is the number of dimensions

This is implemented in pgstac backend:

async def test_bbox_3d(load_test_data, app_client, load_test_collection):
    # ...
    australia_bbox = [106.343365, -47.199523, 0.1, 168.218365, -19.437288, 0.1]
    params = {
        "bbox": australia_bbox,
        "collections": [coll["id"]],
    }
    resp = await app_client.post("/search", json=params)
    assert resp.status_code == 200

But not in stac-fastapi where only 2D coordinates are enforced in str2bbox method:

def str2bbox(x: str) -> Optional[BBox]:
    """Convert string to BBox based on , delimiter."""
    if x:
        t = tuple(float(v) for v in str2list(x))
        assert len(t) == 4, f"BBox '{x}' must have 4 values."
        return t

    return None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions