[GRASS-SVN] r50959 - grass/branches/develbranch_6/raster/r.topidx
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 27 17:57:26 EST 2012
Author: hamish
Date: 2012-02-27 14:57:26 -0800 (Mon, 27 Feb 2012)
New Revision: 50959
Added:
grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb.pl
grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc.pl
Removed:
grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb
grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc
Log:
rename perl scripts to make it more obvious what they are
Deleted: grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb
===================================================================
--- grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb 2012-02-27 20:30:48 UTC (rev 50958)
+++ grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb 2012-02-27 22:57:26 UTC (rev 50959)
@@ -1,45 +0,0 @@
-#!/usr/bin/env perl
-if($#ARGV != 1 || $ARGV[0] =~ m/^-*help$/){
- print "Usage: arc.to.gridatb arc_file gridatb_file\n";
- exit;
-}
-open IN, $ARGV[0] or die;
-$head = 0;
-while(<IN>){
- if(m/^ncols[ \t]+([0-9.]+)[ \t]*$/i){
- $ncols = $1;
- $head |= 0x1;
- }elsif(m/^nrows[ \t]+([0-9.]+)[ \t]*$/i){
- $nrows = $1;
- $head |= 0x2;
- }elsif(m/^xllcorner[ \t]+([0-9.]+)[ \t]*$/i){
- $xllcorner = $1;
- $head |= 0x4;
- }elsif(m/^yllcorner[ \t]+([0-9.]+)[ \t]*$/i){
- $yllcorner = $1;
- $head |= 0x8;
- }elsif(m/^cellsize[ \t]+([0-9.]+)[ \t]*$/i){
- $cellsize = $1;
- $head |= 0x10;
- }elsif(m/^nodata_value[ \t]+([0-9.]+)[ \t]*$/i){
- $nodata_value = $1;
- $head |= 0x20;
- }else{
- die;
- }
- if($head == 0x3f){
- last;
- }
-}
-open OUT, ">$ARGV[1]" or die;
-print OUT <<EOT
-arc.to.gridatb $ARGV[0] $ARGV[1]
-$ncols $nrows $cellsize
-EOT
-;
-while(<IN>){
- s/(?=^|[ \t]*)$nodata_value(\.0*)?(?=([ \t]*|$))/9999.00/g;
- print OUT;
-}
-close IN;
-close OUT;
Copied: grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb.pl (from rev 50958, grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb)
===================================================================
--- grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb.pl (rev 0)
+++ grass/branches/develbranch_6/raster/r.topidx/arc.to.gridatb.pl 2012-02-27 22:57:26 UTC (rev 50959)
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+if($#ARGV != 1 || $ARGV[0] =~ m/^-*help$/){
+ print "Usage: arc.to.gridatb arc_file gridatb_file\n";
+ exit;
+}
+open IN, $ARGV[0] or die;
+$head = 0;
+while(<IN>){
+ if(m/^ncols[ \t]+([0-9.]+)[ \t]*$/i){
+ $ncols = $1;
+ $head |= 0x1;
+ }elsif(m/^nrows[ \t]+([0-9.]+)[ \t]*$/i){
+ $nrows = $1;
+ $head |= 0x2;
+ }elsif(m/^xllcorner[ \t]+([0-9.]+)[ \t]*$/i){
+ $xllcorner = $1;
+ $head |= 0x4;
+ }elsif(m/^yllcorner[ \t]+([0-9.]+)[ \t]*$/i){
+ $yllcorner = $1;
+ $head |= 0x8;
+ }elsif(m/^cellsize[ \t]+([0-9.]+)[ \t]*$/i){
+ $cellsize = $1;
+ $head |= 0x10;
+ }elsif(m/^nodata_value[ \t]+([0-9.]+)[ \t]*$/i){
+ $nodata_value = $1;
+ $head |= 0x20;
+ }else{
+ die;
+ }
+ if($head == 0x3f){
+ last;
+ }
+}
+open OUT, ">$ARGV[1]" or die;
+print OUT <<EOT
+arc.to.gridatb $ARGV[0] $ARGV[1]
+$ncols $nrows $cellsize
+EOT
+;
+while(<IN>){
+ s/(?=^|[ \t]*)$nodata_value(\.0*)?(?=([ \t]*|$))/9999.00/g;
+ print OUT;
+}
+close IN;
+close OUT;
Deleted: grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc
===================================================================
--- grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc 2012-02-27 20:30:48 UTC (rev 50958)
+++ grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc 2012-02-27 22:57:26 UTC (rev 50959)
@@ -1,29 +0,0 @@
-#!/usr/bin/env perl
-if($#ARGV < 1 || $#ARGV == 2 || $#ARGV > 3 || $ARGV[0] =~ m/^-*help$/){
- print "Usage: gridatb.to.arc gridatb_file arc_file [xllcorner yllcorner]\n";
- exit;
-}
-$xllcorner = 0;
-$yllcorner = 0;
-if($#ARGV == 3){
- $xllcorner = $ARGV[2];
- $yllcorner = $ARGV[3];
-}
-open IN, $ARGV[0] or die;
-$title = <IN>;
-($ncols, $nrows, $cellsize) = (<IN> =~ m/^[ \t]*([0-9.]+)[ \t]+([0-9.]+)[ \t]+([0-9.]+)[ \t]*$/);
-open OUT, ">$ARGV[1]" or die;
-print OUT <<EOT
-ncols $ncols
-nrows $nrows
-xllcorner $xllcorner
-yllcorner $yllcorner
-cellsize $cellsize
-NODATA_value 9999
-EOT
-;
-while(<IN>){
- print OUT;
-}
-close IN;
-close OUT;
Copied: grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc.pl (from rev 50958, grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc)
===================================================================
--- grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc.pl (rev 0)
+++ grass/branches/develbranch_6/raster/r.topidx/gridatb.to.arc.pl 2012-02-27 22:57:26 UTC (rev 50959)
@@ -0,0 +1,29 @@
+#!/usr/bin/env perl
+if($#ARGV < 1 || $#ARGV == 2 || $#ARGV > 3 || $ARGV[0] =~ m/^-*help$/){
+ print "Usage: gridatb.to.arc gridatb_file arc_file [xllcorner yllcorner]\n";
+ exit;
+}
+$xllcorner = 0;
+$yllcorner = 0;
+if($#ARGV == 3){
+ $xllcorner = $ARGV[2];
+ $yllcorner = $ARGV[3];
+}
+open IN, $ARGV[0] or die;
+$title = <IN>;
+($ncols, $nrows, $cellsize) = (<IN> =~ m/^[ \t]*([0-9.]+)[ \t]+([0-9.]+)[ \t]+([0-9.]+)[ \t]*$/);
+open OUT, ">$ARGV[1]" or die;
+print OUT <<EOT
+ncols $ncols
+nrows $nrows
+xllcorner $xllcorner
+yllcorner $yllcorner
+cellsize $cellsize
+NODATA_value 9999
+EOT
+;
+while(<IN>){
+ print OUT;
+}
+close IN;
+close OUT;
More information about the grass-commit
mailing list