Changeset 52064


Ignore:
Timestamp:
Jun 13, 2012 11:35:44 PM (4 years ago)
Author:
hamish
Message:

a couple of bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • grass-addons/grass6/raster/r.in.onearth/r.in.onearth.twms

    r52063 r52064  
    179179   i=`expr $i + 1`
    180180done
     181if [ "$MIN" = "9999" ] ; then
     182    #finer than the finest tested
     183    TAKE_i=-3
     184    TAKE=0.000244140625
     185fi
    181186tile_res=`echo "$TAKE_i" | awk '{printf("%.15g", 2^$1)}'`
    182 g.message -d message="min_diff=$MIN  [2^$TAKE_i = $tile_res  ($TAKE * 512)]"
    183 
     187g.message -i message="min_diff=$MIN  [2^$TAKE_i = $tile_res  ($TAKE * 512)]"
    184188
    185189
     
    211215 }'`
    212216
    213 e=`echo "$e $tile_res" | \
     217w=`echo "$w $tile_res" | \
    214218   awk '{ printf("%.15g", -180.0 + int((180.0 + $1) / $2) * $2) }'`
    215 w=`echo "$w $tile_res" | awk '
     219e=`echo "$e $tile_res" | awk '
    216220 function ceil(x)
    217221 {
     
    225229#g.region n=$n s=$s e=$e w=$w
    226230
     231#NUM_TILES_x=`echo "$e $w $tile_res" | awk '{ printf("%d", 1 + (($1 - $2) / $3)) }'`
     232#NUM_TILES_y=`echo "$n $s $tile_res" | awk '{ printf("%d", 1 + (($1 - $2) / $3)) }'`
    227233NUM_TILES_x=`echo "$e $w $tile_res" | awk '{ printf("%d", ($1 - $2) / $3) }'`
    228234NUM_TILES_y=`echo "$n $s $tile_res" | awk '{ printf("%d", ($1 - $2) / $3) }'`
    229 
    230235TOTAL_TILES=`expr $NUM_TILES_x \* $NUM_TILES_y`
    231236
    232 if [ "$TOTAL_TILES" -gt 100 ] ; then
     237if [ "$TOTAL_TILES" -gt 200 ] ; then
    233238    g.message -w "You've told it to download $TOTAL_TILES tiles from NASA's server. Are you sure you want to do that?"
    234239    read result
     
    279284      g.message -d message="modulus=$MODULUS"
    280285      if [ "$MODULUS" = "0" ] || [ "$j" = "$NUM_TILES_y" ] ; then
    281           # stall to let the background jobs finish
    282          g.message -v "Downloading tile [$i,$j] of [${NUM_TILES_x}x$NUM_TILES_y]."
    283          eval $CMD
    284          sleep 0.08
    285          wait
     286          # stall to let the background jobs finish
     287         g.message -v "Downloading tile [$i,$j] of [${NUM_TILES_x}x$NUM_TILES_y]."
     288         eval $CMD
     289         wait
    286290      else
    287          g.message -v "Downloading tile [$i,$j] of [${NUM_TILES_x}x$NUM_TILES_y],"
    288          eval $CMD &
    289          sleep 0.08
     291         g.message -v "Downloading tile [$i,$j] of [${NUM_TILES_x}x$NUM_TILES_y],"
     292         eval $CMD &
    290293      fi
    291294      wait
     
    334337rm -f twms_*.pnm twms_*.jpg row*.pnm
    335338
     339#not needed
     340#far_e=$(echo "$e $tile_res" | awk '{printf("%.9f", $1 + $2)}')
     341#far_s=$(echo "$s $tile_res" | awk '{printf("%.9f", $1 - $2)}')
     342
    336343gdal_translate mosaic_$$.jpg mosaic_$$.tif \
    337   -a_srs EPSG:4326 -a_ullr $w $n $e $s 
     344  -a_srs EPSG:4326 -a_ullr $w $n $e $s
    338345  #-co COMPRESS=DEFLATE
    339346
Note: See TracChangeset for help on using the changeset viewer.