~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to scripts/r.in.wms/r.in.wms

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
 
191
191
# save command line
192
192
if [ "$1" != "@ARGS_PARSED@" ] ; then
193
 
    CMDLINE="`basename $0`"
 
193
    CMDLINE=`basename "$0"`
194
194
    for arg in "$@" ; do
195
195
        CMDLINE="$CMDLINE \"$arg\""
196
196
    done
256
256
# Remember the intial field seperator
257
257
defaultIFS="$IFS"
258
258
 
259
 
# Remember the previous path
260
 
prevPATH="$PATH"
261
 
PATH="$PATH:${GISBASE}/etc/r.in.wms/"
262
 
export PATH
263
259
 
264
260
#####################
265
261
# name:     message
280
276
exitprocedure()
281
277
{
282
278
        g.message -e 'User break!'
283
 
        # is this bogus? won't PATH revert on exit anyway?
284
 
        PATH="$prevPATH"
285
 
        export PATH
286
279
        \rm -f "${TEMPFILE}"*
287
280
        exit 1
288
281
}
396
389
        if [ -x "`which xml2`" ] ; then
397
390
                cat "$CAPABILITIES_FILE" | xml2 | \
398
391
                  grep "Layer/SRS=\|Layer/Name=\|Layer/Title=\|Style/Name=\|Style/Title=\|Layer/Abstract=" | \
399
 
                  sed -e "s/.*Layer\\/Name=/\n\nLAYER: /" \
 
392
                  sed -e 's/.*Layer\\/Name=/\
 
393
\
 
394
LAYER: /' \
400
395
                      -e "s/.*Layer\\/SRS=/  SRS: /" \
401
396
                      -e "s/.*Layer\\/Title=/  Title: /" \
402
397
                      -e "s/.*Layer\\/Abstract=/  |/" \
406
401
 
407
402
        else : # xml2 is not available
408
403
                g.message -w "The 'xml2' program was not found. Proceeding with internal XML parsing which may not be as reliable."
409
 
                sed -e "s/<Layer/\n<Layer/g" \
410
 
                    -e "s/<Name>/\n<Name>/g" \
411
 
                    -e "s/<Style>/\n<Style>/g" \
412
 
                    -e "s/<Title>/\n<Title>/g" \
 
404
                sed -e 's/<Layer/\
 
405
<Layer/g' \
 
406
                    -e 's/<Name>/\
 
407
<Name>/g' \
 
408
                    -e 's/<Style>/\
 
409
<Style>/g' \
 
410
                    -e 's/<Title>/\
 
411
<Title>/g' \
413
412
                    "$CAPABILITIES_FILE" | \
414
413
                    grep "Name\|Title\|Style\|Layer" | \
415
 
                    sed -e "s/<Layer .*>/-=-=-=-=-\n\nLAYER:/" \
 
414
                    sed -e 's/<Layer .*>/-=-=-=-=-\
 
415
\
 
416
LAYER:/' \
416
417
                      -e "s/<\/Layer.*>//" \
417
418
                      -e "s/<Name>\s*\([^<]*\)/~\1~/g" \
418
419
                      -e "s/<\/Name>\n\?//g" \
511
512
 
512
513
if [ $GIS_FLAG_D -eq 0 ] ; then
513
514
        message 1 "wms.request $REQUEST"
514
 
        eval "wms.request $REQUEST"
 
515
        eval "\"$GISBASE/etc/r.in.wms/wms.request\" $REQUEST"
515
516
        if [ $? -ne 0 ] ; then
516
517
           g.message -e "wms.request failure" 
517
518
           exit 1
524
525
addargument DOWNLOAD curloptions "${GIS_OPT_CURLOPTIONS}"
525
526
 
526
527
message 1 "wms.download $DOWNLOAD"
527
 
eval "wms.download $DOWNLOAD"
 
528
eval "\"$GISBASE/etc/r.in.wms/wms.download\" $DOWNLOAD"
528
529
 
529
530
# Job 2: make list of files
530
531
 
560
561
fi
561
562
 
562
563
message 1 "r.in.gdalwarp $GDALWARP"
563
 
eval "r.in.gdalwarp $GDALWARP"
 
564
eval "\"$GISBASE/etc/r.in.wms/r.in.gdalwarp\" $GDALWARP"
564
565
if [ $? -ne 0 ] ; then
565
566
   g.message -e message="r.in.gdalwarp failed"
566
567
   exit 1