Skip to content

"collection" attribute returned from collection_search() with "fields.include" #394

@alukach

Description

@alukach

We get a strange "collection": null on each collection returned when using the fields.include parameter on collection search.

postgis=# SELECT get_version();
-[ RECORD 1 ]------
get_version | 0.9.8

-- Getting a strange "collection: null" when using "include"
postgis=# SELECT collection_search('{"fields": {"include": ["id"]}}');
-[ RECORD 1 ]-----+--------------------------------------------------------------------------------------------------------------
collection_search | {"links": [], "collections": [{"id": "joplin", "collection": null}], "numberMatched": 1, "numberReturned": 1}

-- Don't get "collection" when using inverse "exclude"
postgis=# SELECT collection_search('{"fields": {"exclude": ["description", "extent", "stac_version", "type", "license", "links"]}}');
-[ RECORD 1 ]-----+------------------------------------------------------------------------------------------
collection_search | {"links": [], "collections": [{"id": "joplin"}], "numberMatched": 1, "numberReturned": 1}

-- FYI: the collection
postgis=# SELECT * FROM collections;
-[ RECORD 1 ]---+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
key             | 1
id              | joplin
content         | {"id": "joplin", "type": "Collection", "links": [{"rel": "license", "href": "https://creativecommons.org/licenses/publicdomain/", "title": "public domain"}], "extent": {"spatial": {"bbox": [[-94.6911621, 37.0332547, -94.402771, 37.1077651]]}, "temporal": {"interval": [["2000-02-01T00:00:00Z", "2000-02-12T00:00:00Z"]]}}, "license": "public-domain", "description": "This imagery was acquired by the NOAA Remote Sensing Division to support NOAA national security and emergency response requirements. In addition, it will be used for ongoing research efforts for testing and developing standards for airborne digital imagery. Individual images have been combined into a larger mosaic and tiled for distribution. The approximate ground sample distance (GSD) for each pixel is 35 cm (1.14 feet).", "stac_version": "1.0.0"}
base_item       | {"type": "Feature", "assets": null, "collection": "joplin", "stac_version": "1.0.0"}
geometry        | 0103000020E6100000010000000500000005EFF5FF3BAC57C01A78A4B04184424005EFF5FF3BAC57C039132E3FCB8D4240BE310400C79957C039132E3FCB8D4240BE310400C79957C01A78A4B04184424005EFF5FF3BAC57C01A78A4B041844240
datetime        | 2000-02-01 00:00:00+00
end_datetime    | 2000-02-12 00:00:00+00
private         | (null)
partition_trunc | (null)

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