Strabon

annotate examples/teleios/runNoaRefinement.sh @ 1426:014379fdddf2

fixed the tests of geof:distance and geof:buffer, that had wrong results due to the
conversion of the resulting geometry to the srid 3857.
The results are validated using PostGIS, where in the case of buffer there are
small differences in the precision.
Moreover, in the case of BufferMetresTest, there was no point in having as distance
1m, because the geometry did not change, so i added 55000 metres instead (about 0.5 degrees).
author Stella Giannakopoulou <sgian@di.uoa.gr>
date Wed Sep 24 17:43:53 2014 +0300 (2014-09-24)
parents
children
rev   line source
ggarbis@701 1 #! /bin/bash
ggarbis@701 2
ggarbis@701 3 #
ggarbis@701 4 # This Source Code Form is subject to the terms of the Mozilla Public
ggarbis@701 5 # License, v. 2.0. If a copy of the MPL was not distributed with this
ggarbis@701 6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
ggarbis@701 7 #
ggarbis@701 8 # Copyright (C) 2010, 2011, 2012, Pyravlos Team
ggarbis@701 9 #
ggarbis@701 10 # http://www.strabon.di.uoa.gr/
ggarbis@701 11 #
ggarbis@701 12
ggarbis@701 13
ggarbis@701 14 dataDir="/var/www/shapefiles2012all"
ggarbis@701 15 dataUrl="http://challenge.strabon.di.uoa.gr/shapefiles2012all/"
ggarbis@701 16 name="HMSG2_IR_039_s7"
ggarbis@701 17 suffix=".n3"
ggarbis@701 18
ggarbis@701 19 logFile="chain.log"
ggarbis@701 20 countTime="/usr/bin/time -ao ${logFile} -f %e"
ggarbis@701 21 echo > ${logFile}
ggarbis@701 22
ggarbis@701 23 insertMunicipalities="`cat insertMunicipalities.rq`"
ggarbis@701 24 deleteSeaHotspots="`cat deleteSeaHotspots.rq`"
ggarbis@701 25 landUseInvalidForFires="`cat landUseInvalidForFires.rq`"
ggarbis@701 26 refinePartialSeaHotspots="`cat refinePartialSeaHotspots.rq`"
ggarbis@701 27 refineTimePersistence="`cat refineTimePersistence.rq`"
ggarbis@701 28
ggarbis@701 29 # Initialize
ggarbis@701 30 #sudo service postgresql restart
ggarbis@701 31 #dropdb endpoint
ggarbis@701 32 #createdb endpoint -T template_postgis
ggarbis@701 33 #sudo service tomcat6 restart
ggarbis@701 34 #./endpoint store http://localhost:8080/endpoint N-Triples -u http://pathway.di.uoa.gr/hotspots/grid_4.nt
ggarbis@701 35
ggarbis@701 36 #./scripts/endpoint query http://localhost:8080/endpoint "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}"
ggarbis@701 37 #echo "Continue?"
ggarbis@701 38 #read a
ggarbis@701 39
ggarbis@701 40
ggarbis@701 41 for Month in `sec 7 8`; do
ggarbis@701 42 for d in `sec 1 31`; do
ggarbis@701 43 for h in `seq 0 12`; do
ggarbis@701 44 for m in `seq 0 15 45`; do
ggarbis@701 45 time=`printf "%02d%02d\n" $h $m`
ggarbis@701 46 time2=`printf "%02d:%02d\n" $h $m`
ggarbis@701 47 date=`printf "%02d-%02d\n" $Month $d`
ggarbis@701 48 ## file=${dataDir}${name}_${time}$suffix
ggarbis@701 49 # file=${dataUrl}${name}_${time}$suffix
ggarbis@701 50 #
ggarbis@701 51 # # store file
ggarbis@701 52 # echo -n "storing 2007-08-25T${time2}:00 " >> ${logFile}
ggarbis@701 53 ## ${countTime} ./strabon -db endpoint store $file
ggarbis@701 54 # ${countTime} ./endpoint store http://localhost:8080/endpoint N-Triples -u ${file}
ggarbis@701 55 #
ggarbis@701 56 ## echo "File ${file} stored!" >> ${logFile}
ggarbis@701 57 ## echo "Continue?"
ggarbis@701 58 ## read a
ggarbis@701 59
ggarbis@701 60 # deleteSeaHotspots
ggarbis@701 61 echo -n "deleteSeaHotspots 2007-${date}T${time2}:00 " >> ${logFile}
ggarbis@701 62 query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
ggarbis@701 63 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
ggarbis@701 64 sed "s/SENSOR/MSG2/g"`
ggarbis@701 65 # ${countTime} ./strabon -db endpoint update "${query}"
ggarbis@701 66 ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
ggarbis@701 67
ggarbis@701 68 # echo "File ${file} deleteSeaHotspots done!"
ggarbis@701 69 # echo "Continue?"
ggarbis@701 70 # read a
ggarbis@701 71
ggarbis@701 72 # refinePartialSeaHotspots
ggarbis@701 73 echo -n "refinePartialSeaHotspots 2007-${date}T${time2}:00 " >> ${logFile}
ggarbis@701 74 query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
ggarbis@701 75 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
ggarbis@701 76 sed "s/SENSOR/MSG2/g"`
ggarbis@701 77 # ${countTime} ./strabon -db endpoint update "${query}"
ggarbis@701 78 ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
ggarbis@701 79
ggarbis@701 80 # echo "File ${file} refinePartialSeaHotspots done!"
ggarbis@701 81 # echo "Continue?"
ggarbis@701 82 # read a
ggarbis@701 83
ggarbis@701 84 # refineTimePersistence
ggarbis@701 85 echo -n "refineTimePersistence 2007-${date}T${time2}:00 " >> ${logFile}
ggarbis@701 86 min_acquisition_time=`date --date="2007-${date} ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%m:00`
ggarbis@701 87 query=`echo "${refineTimePersistence}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
ggarbis@701 88 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
ggarbis@701 89 sed "s/SENSOR/MSG2/g" | \
ggarbis@701 90 sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \
ggarbis@701 91 sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g"`
ggarbis@701 92
ggarbis@701 93 # echo "Query:"
ggarbis@701 94 # echo "${query}"
ggarbis@701 95 # echo "Continue?"
ggarbis@701 96 # read a
ggarbis@701 97 # ${countTime} ./strabon -db endpoint update "${query}"
ggarbis@701 98 # ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
ggarbis@701 99 ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
ggarbis@701 100
ggarbis@701 101 # echo "File ${file} refinePartialSeaHotspots done!"
ggarbis@701 102 # echo "Continue?"
ggarbis@701 103 # read a
ggarbis@701 104 done
ggarbis@701 105 done
ggarbis@701 106
ggarbis@701 107
ggarbis@701 108 #for f in `ls /home/ggarbis/TELEIOS/NOA_Processing_Chain/chain_msg2/data/out_triples/HMSG2_IR_039_s7_070825_*.hotspots.n3`
ggarbis@701 109 #do
ggarbis@701 110
ggarbis@701 111 # echo "Store $f"
ggarbis@701 112 # ${countTime} ./scripts/strabon -db endpoint store $f
ggarbis@701 113 #
ggarbis@701 114 #
ggarbis@701 115 #done
ggarbis@701 116