Ticket #1849: import.sh

File import.sh, 755 bytes (added by Dimitar Misev, 6 years ago)
Line 
1#!/bin/bash
2
3# generate random tile
4[ -f 3145728 ] || head -c 3145728 /dev/urandom > 3145728
5
6# width/height of the image
7l=45
8
9R="directql --user rasadmin --passwd rasadmin -d $RASDATA/RASBASE"
10C="test_coll_7GB_rgb"
11
12$R -q "create collection $C RGBSet" > /dev/null
13$R -q "insert into $C values \$1" -f 3145728 --mddtype RGBImage --mdddomain [0:1023,0:1023] > /dev/null
14
15echo "Updating collection $C..."
16
17for i in $(seq 0 $l); do
18 for j in $(seq 0 $l); do
19 lox=$(($i * 1024))
20 loy=$(($j * 1024))
21 hix=$(($lox + 1024 - 1))
22 hiy=$(($loy + 1024 - 1))
23 echo "i: $i, j: $j..."
24 $R -q "update $C as m set m assign \$1" -f 3145728 --mddtype RGBImage --mdddomain [$lox:$hix,$loy:$hiy] > /dev/null
25 done
26done
27
28echo "done ingestion of collection $C".