It would be nice to be able to enable pgstac's "update collection extent using items" feature here:
|
def customization(cursor, params) -> None: |
|
""" |
|
CUSTOMIZED YOUR PGSTAC DATABASE |
|
|
|
ref: https://github.com/stac-utils/pgstac/blob/main/docs/src/pgstac.md |
|
|
|
""" |
|
if str(params.get("context", "FALSE")).upper() == "TRUE": |
|
# Add CONTEXT=ON |
|
pgstac_settings = """ |
|
INSERT INTO pgstac_settings (name, value) |
|
VALUES ('context', 'on') |
|
ON CONFLICT ON CONSTRAINT pgstac_settings_pkey DO UPDATE SET value = excluded.value;""" |
|
cursor.execute(sql.SQL(pgstac_settings)) |
|
|
|
if str(params.get("mosaic_index", "TRUE")).upper() == "TRUE": |
|
# Create index of searches with `mosaic`` type |
|
cursor.execute( |
|
sql.SQL( |
|
"CREATE INDEX IF NOT EXISTS searches_mosaic ON searches ((true)) WHERE metadata->>'type'='mosaic';" |
|
) |
|
) |
Relevant pgstac docs: https://github.com/stac-utils/pgstac/blob/main/docs/src/pypgstac.md#automated-collection-extent-updates
cc @bitnerd
It would be nice to be able to enable pgstac's "update collection extent using items" feature here:
eoapi-cdk/lib/database/bootstrapper_runtime/handler.py
Lines 146 to 167 in 70e8437
Relevant pgstac docs: https://github.com/stac-utils/pgstac/blob/main/docs/src/pypgstac.md#automated-collection-extent-updates
cc @bitnerd