[GRASS-user] Error and correction for v.swathwidth

David,

I was testing out your script v.swathwidth and I ran into an error. I took a
look at your code and inserted echo comments and sleep statements to slow
the execution of the program down so I could see where the error was
occurring. It looks like the program is choking on the "2>&1 > /dev/null"
statement on the r.mapcalc line:

GRASS 6.1.cvs (FundyBathy):~/coderepo > v.swathwidth trackline=Drumlin_Line
elevation=Drumlins_10m_fill beamwidth=5.5 distance=100
out=Drumlin_Line_swath --o

invalid map: dev #Critical error occurs here
invalid map: null
Syntax error
Completed r.mapcalc...

Building topology ...
1154 primitives registered
Building areas: 100%
0 areas built
0 isles built
Attaching islands:
Attaching centroids: 100%
Topology was built.
Number of nodes : 1154
Number of primitives: 1154
Number of points : 1154
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0
1154 points written to output map

Completed v.to.points...

Completed v.db.addcol...
ERROR: Cannot find raster map

Completed v.what.rast...
Lines buffers ... 100%

Building parts of topology ...
Building topology ...
0 primitives registered
Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : -
Number of isles : -
Snapping boundaries ...
All vertices: 0
Registered points (unique coordinates): 0
Nodes marked as anchor : 0
Nodes marked to be snapped : 0
Snapped vertices : 0
New vertices : 0
Breaking boundaries ...
Intersections: 0
Removing duplicates ...
Duplicates: 0
Attaching islands ...
Building topology ...
0 areas built
0 isles built
Attaching islands:
Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0
Attaching centroids ...
Building topology ...
Attaching centroids: Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0
Rebuilding topology ...
Building topology ...
0 primitives registered
0 areas built
0 isles built
Attaching islands:
Attaching centroids: Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0

Completed v.buffer...
+---------------------------------+---------------+
| Tool | Threshold |
+---------------------------------+---------------+
| Break | 0.000000e+00 |
+---------------------------------+---------------+
Copying vector lines ...
--------------------------------------------------
Rebuilding parts of topology ...
Building topology ...
0 primitives registered
Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : -
Number of isles : -
--------------------------------------------------
Tool: Break lines at intersections
Intersections: 0
--------------------------------------------------
Rebuilding topology for output vector ...
Building topology ...
0 primitives registered
0 areas built
0 isles built
Attaching islands:
Attaching centroids: Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0

Completed v.clean...

Completed v.category...

Writing attributes ...
Removing duplicate centroids ...Building topology ...
0 primitives registered
0 areas built
0 isles built
Attaching islands:
Attaching centroids: Topology was built.
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0

Completed v.extract...

RENAME [temp_circles4] to [Drumlin_Line_swath]
WARNING: The vector 'Drumlin_Line_swath' already exists and will be
         overwritten.
Swath width map written to: Drumlin_Line_swath

Commenting out the 2>&1 /dev/null part of your r.mapcalc line fixes the
error, and the program completes successfully.

~ Eric.

Should be fixed now, I think.

David

On 6/14/06, Hamish <hamish_nospam@yahoo.com> wrote:

> It looks like the program is choking on the "2>&1 > /dev/null"
> statement on the r.mapcalc line:

(generally it should just read "2>&1 /dev/null" ?)

r.mapcalc shouldn't need a "> /dev/null" at all though, it only puts out
a 100% done, unless there is an error.

Hamish

--
David Finlayson