<html style="direction: ltr;">
<head>
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="preferred-charset"
bgcolor="#FFFFFF" text="#000000">
A few more details regarding v.out.ogr when layer=2<br>
I see this ticket, possibly similar:
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/grass/ticket/991">http://trac.osgeo.org/grass/ticket/991</a><br>
<br>
I tried to export to PostGIS, and again, all attribute fields are
created but all values are NULL. I also tried with the layer 2
database as a dbf file, instead of sqlite. Same result. <br>
<br>
This was all with GRASS 6.4.2 on scientific linux 6<br>
<br>
Thanks,<br>
Micha<br>
<br>
On 08/28/2012 02:57 PM, Micha Silver wrote:
<blockquote cite="mid:503CB22E.8000202@arava.co.il" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1255">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
I'm having two problems when exporting the output of
r.stream.order to a shapefile.<br>
I have attached the created table (saved in my setup in sqlite) to
the 'streams' map thru layer 2. Then <br>
v.db.select streams layer=2 <br>
shows all the details of strahler order, prev_str, etc. <br>
<br>
<br>
First problem: When I try to do v.out.ogr, the column header named
"next_stream" fails because it's 10 characters long, too long for
a shapefile dbf. As a result all attributes are missing. Here's a
patch to io.c in r.stream.order I put in place to correct this:<br>
<br>
[micha@SL6 r.stream.order]$ diff -u io.c.orig io.c<br>
--- io.c.orig 2012-08-28 12:21:46.020275045 +0300<br>
+++ io.c 2012-08-28 12:22:17.951382882 +0300<br>
@@ -292,7 +292,7 @@<br>
/* table definition */<br>
char *tab_cat_col_name = "cat integer";<br>
char *tab_stream = "stream integer";<br>
- char *tab_next_stream = "next_stream integer";<br>
+ char *tab_next_stream = "next_str integer";<br>
char *tab_prev_streams;<br>
char *tab_strahler = "strahler integer";<br>
char *tab_horton = "horton integer";<br>
@@ -300,7 +300,7 @@<br>
char *tab_hack = "hack integer";<br>
char *tab_length = "length double precision";<br>
char *tab_cumlength = "cum_length double precision";<br>
- char *tab_stright = "stright double precision";<br>
+ char *tab_stright = "straight double precision";<br>
char *tab_fractal = "fractal double precision";<br>
char *tab_distance = "out_dist double precision";<br>
char *tab_topo_dim = "topo_dim integer";<br>
<br>
(Also corrects a small typo in the column name "stright")<br>
<br>
After recompiling, then rerunning the r.stream.order addon, the
sqlite table now has all column headers <= 10 characters
suitable to shapefile.<br>
<br>
<br>
Problem 2, where I'm stuck. I export the vector map using :<br>
v.out.ogr streams layer=2 dsn=streams.shp<br>
The process finishes OK, and the shape is created with all attrib
columns, but *all* values are NULL (including the cat). Any ideas
what I've done wrong? <br>
<br>
Thanks,<br>
Micha <br>
<br>
<br>
This mail was received via Mail-SeCure System.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
GIS Consultant, Arava Development Co.
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il">http://www.surfaces.co.il</a></pre>
</body>
</html>