EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 1420653d authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Creat database views for mapcache items

Allows smaller queries in tilesets
parent 29bdbfc7
No related branches found
No related tags found
1 merge request!6Cache native swift
......@@ -64,6 +64,7 @@ ADD configure.sh \
seeder.py \
mapcache-template.xml \
entrypoint.sh \
mapcache_items_view.sql \
/
RUN chmod -v +x \
......
......@@ -108,5 +108,6 @@ else
echo "Using existing index.html"
fi
echo "Store environment variables for cron."
env > /etc/environment
# create a database view for the mapcache items
echo "Creating database view for mapcache items"
psql "host=${DB_HOST} user=${DB_USER} password=${DB_PW} dbname=${DB_NAME} port=${DB_PORT}" -f /mapcache_items_view.sql
......@@ -13,6 +13,6 @@ echo "Installing packages"
VERSION=1.8.0-1~bionic1eox5
DEBIAN_FRONTEND=noninteractive apt install -y \
libmapcache1=${VERSION} libapache2-mod-mapcache=${VERSION} mapcache-tools=${VERSION} \
sqlite3 curl apache2 python3-dateutil python3-redis wait-for-it
sqlite3 curl apache2 python3-dateutil python3-redis wait-for-it postgresql-client
rm -rf /var/lib/apt/lists/*
CREATE OR REPLACE VIEW mapcache_items AS
SELECT
product_eoobject."begin_time" AS "begin_time",
product_eoobject."end_time" AS "end_time",
product_eoobject."footprint" AS "footprint",
CONCAT(to_char(product_eoobject."begin_time", 'YYYY-MM-DD"T"HH24:MI:SS"Z"'), CONCAT('/', to_char(product_eoobject."end_time", 'YYYY-MM-DD"T"HH24:MI:SS"Z"'))) AS "interval",
collection_eoobject.identifier AS "collection"
FROM "coverages_product"
INNER JOIN "coverages_product_collections" ON ("coverages_product"."eoobject_ptr_id" = "coverages_product_collections"."product_id")
INNER JOIN "coverages_collection" collection ON ("coverages_product_collections"."collection_id" = collection."eoobject_ptr_id")
INNER JOIN "coverages_eoobject" ON (collection."eoobject_ptr_id" = "coverages_eoobject"."id")
INNER JOIN "coverages_eoobject" product_eoobject ON ("coverages_product"."eoobject_ptr_id" = product_eoobject."id")
INNER JOIN "coverages_eoobject" collection_eoobject ON (collection."eoobject_ptr_id" = collection_eoobject."id")
;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment