Skip to content
Snippets Groups Projects

Switch to pulling tile index information from postgres server

Merged David Hoese requested to merge feature-pg-index into master
Files
5
@@ -93,7 +93,7 @@ add_postgres_tables() {
docker exec -i ${PG_SERVER_NAME} psql -U ${POSTGRES_USER} <<EOF
CREATE TABLE IF NOT EXISTS g16_abi_radf_l1b_c01 (
gid SERIAL PRIMARY KEY,
start_time CHAR(19) NOT NULL UNIQUE,
start_time TIMESTAMP WITHOUT TIME ZONE NOT NULL UNIQUE,
location VARCHAR(255) NOT NULL,
bbox_geometry geometry(POLYGON, 930916)
)
@@ -186,6 +186,9 @@ kill_test_container() {
kill_postgres() {
debug "Killing postgres container..."
debug "-----------------------------------------"
docker logs ${PG_SERVER_NAME}
debug "-----------------------------------------"
docker kill ${PG_SERVER_NAME} >/dev/null
debug "Done killing postgres container."
}
@@ -201,6 +204,8 @@ curl_layer_times() {
time_result=$(curl --fail -sS "http://localhost:8888/wms_times/g16/abi/radf/C01")
time_status=$?
if [[ $time_status -ne 0 ]]; then
error "Requesting layer times failed"
error "$time_result"
return $time_status
fi
@@ -218,14 +223,12 @@ curl_empty_tile() {
debug "Starting curl basic mapfile request for non-existent tile..."
# NOTE: The time doesn't actually exist and no image data is available. A blank image should be returned
curl --fail -sS -o "empty_tile.png" "http://localhost:8888/wms/g16/abi/radf/l1b?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-2500000%2c-2500000%2c2500000%2c2500000&WIDTH=256&HEIGHT=256&FORMAT=rgba&SRS=EPSG%3a930916&LAYERS=C01&TIME=2022-04-20T16:00:12Z" >/dev/null
cp empty_tile.png /tmp/empty_tile_test.png
check_image_content "empty_tile.png" 1
}
curl_valid_tile() {
debug "Starting curl basic mapfile request for valid tile..."
curl --fail -sS -o "valid_tile.png" "http://localhost:8888/wms/g16/abi/radf/l1b?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-2500000%2c-2500000%2c2500000%2c2500000&WIDTH=256&HEIGHT=256&FORMAT=rgba&SRS=EPSG%3a930916&LAYERS=C01&TIME=${C01_ISOTIME}Z" >/dev/null
cp valid_tile.png /tmp/valid_tile.png
check_image_content "valid_tile.png" 0
}
@@ -285,7 +288,6 @@ run_basic_postgres_tests() {
start_postgres
start_pg_test_container
gtiff_fn="/data/$(create_fake_geotiff)"
add_shapefile_content "${gtiff_fn}"
add_postgres_projections
add_postgres_tables
add_postgres_content "${gtiff_fn}"
Loading