[GRASS-SVN] r50961 - grass/trunk/raster/r.topidx

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 27 18:23:18 EST 2012


Author: hamish
Date: 2012-02-27 15:23:18 -0800 (Mon, 27 Feb 2012)
New Revision: 50961

Added:
   grass/trunk/raster/r.topidx/arc.to.gridatb.pl
   grass/trunk/raster/r.topidx/gridatb.to.arc.pl
Removed:
   grass/trunk/raster/r.topidx/arc.to.gridatb
   grass/trunk/raster/r.topidx/gridatb.to.arc
Log:
rename perl scripts to make it more obvious what they are (merge from devbr6)

Deleted: grass/trunk/raster/r.topidx/arc.to.gridatb
===================================================================
--- grass/trunk/raster/r.topidx/arc.to.gridatb	2012-02-27 23:16:14 UTC (rev 50960)
+++ grass/trunk/raster/r.topidx/arc.to.gridatb	2012-02-27 23:23:18 UTC (rev 50961)
@@ -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/trunk/raster/r.topidx/arc.to.gridatb.pl (from rev 50960, grass/trunk/raster/r.topidx/arc.to.gridatb)
===================================================================
--- grass/trunk/raster/r.topidx/arc.to.gridatb.pl	                        (rev 0)
+++ grass/trunk/raster/r.topidx/arc.to.gridatb.pl	2012-02-27 23:23:18 UTC (rev 50961)
@@ -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/trunk/raster/r.topidx/gridatb.to.arc
===================================================================
--- grass/trunk/raster/r.topidx/gridatb.to.arc	2012-02-27 23:16:14 UTC (rev 50960)
+++ grass/trunk/raster/r.topidx/gridatb.to.arc	2012-02-27 23:23:18 UTC (rev 50961)
@@ -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/trunk/raster/r.topidx/gridatb.to.arc.pl (from rev 50960, grass/trunk/raster/r.topidx/gridatb.to.arc)
===================================================================
--- grass/trunk/raster/r.topidx/gridatb.to.arc.pl	                        (rev 0)
+++ grass/trunk/raster/r.topidx/gridatb.to.arc.pl	2012-02-27 23:23:18 UTC (rev 50961)
@@ -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