[GRASS-SVN] r61838 - in grass-addons/grass7/raster: . r.to.vect.lines
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 7 20:14:31 PDT 2014
Author: neteler
Date: 2014-09-07 20:14:31 -0700 (Sun, 07 Sep 2014)
New Revision: 61838
Added:
grass-addons/grass7/raster/r.to.vect.lines/
grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.html
Removed:
grass-addons/grass7/raster/r.to.vect.lines/description.html
Modified:
grass-addons/grass7/raster/r.to.vect.lines/Makefile
grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.py
Log:
r.to.vect.lines addon: port to G7 (needs testing)
Modified: grass-addons/grass7/raster/r.to.vect.lines/Makefile
===================================================================
--- grass-addons/grass6/raster/r.to.vect.lines/Makefile 2014-08-01 16:55:30 UTC (rev 61497)
+++ grass-addons/grass7/raster/r.to.vect.lines/Makefile 2014-09-08 03:14:31 UTC (rev 61838)
@@ -1,6 +1,6 @@
MODULE_TOPDIR = ../..
-PGM = r.to.vect.lines.py
+PGM = r.to.vect.lines
include $(MODULE_TOPDIR)/include/Make/Script.make
Deleted: grass-addons/grass7/raster/r.to.vect.lines/description.html
===================================================================
--- grass-addons/grass6/raster/r.to.vect.lines/description.html 2014-08-01 16:55:30 UTC (rev 61497)
+++ grass-addons/grass7/raster/r.to.vect.lines/description.html 2014-09-08 03:14:31 UTC (rev 61838)
@@ -1,52 +0,0 @@
-<h2>NOTES</h2>
-
-Extracts rows from a raster map as 3D vector lines.
-<p>
-Reads a raster map, writes to a vector map.
-<p>
-Doesn't check if output map already exists. (fixme)
-<p>
-The category given to the line refers to the row number. (starting with category 0!)
-<p>
-Nulls within a row are skipped, so holes will be filled by a straight line. (fixme)
-Nulls at the ends of lines are not included in the output line.
-<p>
-Nulls are not handled very well and may sneak through as very negative numbers. (fixme)
-
-
-<h2>EXAMPLE</h2>
-
-Display a wiggle plot in NVIZ:
-<!-- todo: variable area wiggle plots, where negative areas are filled -->
-<br>
-(Spearfish dataset)
-
-<div class="code"><pre>
-g.region rast=elevation.dem
-r.to.vect.lines.py in=elevation.dem out=wiggle_lines
-eval `v.info -g wiggle_lines`
-r.mapcalc "floor = $bottom"
-nviz elev=floor vector=wiggle_lines
-</pre></div>
-
-<img src="r_to_vect_lines_example.png" alt="r.to.vect.lines example">
-
-
-<h2>SEE ALSO</h2>
-
-<em>
-<a href="r.to.vect.html">r.to.vect</a><br>
-<a href="v.in.lines.html">v.in.lines</a><br>
-</em>
-
-
-<h2>AUTHOR</h2>
-
-Hamish Bowman<br>
-<i>
-Dept. of Geology<br>
-University of Otago<br>
-Dunedin, New Zealand</i>
-
-<p>
-<i>Last changed: $Date$</i>
Copied: grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.html (from rev 61497, grass-addons/grass6/raster/r.to.vect.lines/description.html)
===================================================================
--- grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.html (rev 0)
+++ grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.html 2014-09-08 03:14:31 UTC (rev 61838)
@@ -0,0 +1,56 @@
+<h2>NOTES</h2>
+
+Extracts rows from a raster map as 3D vector lines.
+<p>
+Reads a raster map, writes to a vector map.
+<p>
+Doesn't check if output map already exists. (fixme)
+<p>
+The category given to the line refers to the row number. (starting with category 0!)
+<p>
+Nulls within a row are skipped, so holes will be filled by a straight line. (fixme)
+Nulls at the ends of lines are not included in the output line.
+<p>
+Nulls are not handled very well and may sneak through as very negative numbers. (fixme)
+
+
+<h2>EXAMPLE</h2>
+
+Display a wiggle plot in NVIZ:
+<!-- todo: variable area wiggle plots, where negative areas are filled -->
+<br>
+(Spearfish dataset)
+
+<div class="code"><pre>
+g.region rast=elevation.dem
+r.to.vect.lines.py in=elevation.dem out=wiggle_lines
+eval `v.info -g wiggle_lines`
+r.mapcalc "floor = $bottom"
+nviz elev=floor vector=wiggle_lines
+
+# alternative
+m.nviz.image elevation_map=floor vline=wiggle_lines resolution_fine=1 \
+ zexag=20 out=wiggle.png perspective=5
+</pre></div>
+
+<img src="r_to_vect_lines_example.png" alt="r.to.vect.lines example">
+
+
+<h2>SEE ALSO</h2>
+
+<em>
+<a href="r.to.vect.html">r.to.vect</a>,
+<a href="v.in.lines.html">v.in.lines</a>
+</em>
+
+
+<h2>AUTHOR</h2>
+
+Hamish Bowman<br>
+<i>
+Dept. of Geology<br>
+University of Otago<br>
+Dunedin, New Zealand</i>
+
+<p>
+<i>Last changed: $Date$</i>
Modified: grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.py
===================================================================
--- grass-addons/grass6/raster/r.to.vect.lines/r.to.vect.lines.py 2014-08-01 16:55:30 UTC (rev 61497)
+++ grass-addons/grass7/raster/r.to.vect.lines/r.to.vect.lines.py 2014-09-08 03:14:31 UTC (rev 61838)
@@ -82,12 +82,16 @@
#### Raster map setup
# find raster map in search path
- mapset = G_find_cell2(inmap, '')
- if not mapset:
- sys.exit("Raster map <%s> not found" % inmap)
+ mapset = None
+ if '@' in inmap:
+ inmap, mapset = inmap.split('@')
+ gfile = grass.find_file(name = inmap, element = 'cell', mapset = mapset)
+ if not gfile['name']:
+ grass.fatal(_("Raster map <%s> not found") % inmap)
+
# determine the inputmap type (CELL/FCELL/DCELL)
- data_type = G_raster_map_type(inmap, mapset)
+ data_type = Rast_get_map_type(inmap, mapset)
if data_type == CELL_TYPE:
ptype = POINTER(c_int)
More information about the grass-commit
mailing list