<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:verdana,helvetica,sans-serif;font-size:10pt">Hi Micha <br><br>Thanks for your help. I followed your instructions to add add separate cat values for each point, so the results of v.category Contour_points_cats opt=report now looks like this <br>v.category Contour_points_cats opt=report<br>Layer: 2<br>type count min max<br>point 644858 1 644858<br>line 0 0 0<br>boundary 0
0 0<br>centroid 0 0 0<br>area 0 0 0<br>all 644858 1 644858<br>Layer/table: 1/Contour_points_cats<br>type count min max<br>point 644858 1 644858<br>line
0 0 0<br>boundary 0 0 0<br>centroid 0 0 0<br>area 0 0 0<br>all 644858 1 644858<br><br>I added a column v.db.addcol map=Contour_points_cats@PERMANENT layer=1 {columns=rast_value double precision} (as my raster is a float), then ran with error<br><br>v.what.rast
vector=Contour_points_cats@PERMANENT raster=dartmoor1@PERMANENT layer=1 column=rast_value<br><br>No record for category 553 in table <Contour_points_cats><br><br>No record for category 263 in table <Contour_points_cats><br>No record for category 668 in table <Contour_points_cats><br><br>essentially the "No Record" error was repeated lots of times and the tool stopped working.<br>
<div><br></div><div style="font-family: verdana,helvetica,sans-serif; font-size: 10pt;">I'm a bit stumped by this - any suggestions? (I have double checked my region to make sure it incorporates the whole area of interest)<br><br>cheers,<br>Rebecca<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Micha Silver <micha@arava.co.il><br><b><span style="font-weight: bold;">To:</span></b> Rebecca Bennett <rabennett@ymail.com><br><b><span style="font-weight: bold;">Cc:</span></b> grass-user@lists.osgeo.org<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, 8 June, 2010 17:57:57<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [GRASS-user] Problems with v.what.rast<br></font><br>
On 06/08/2010 05:39 PM, Rebecca Bennett wrote:
<blockquote type="cite">
<div style="font-family: verdana,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<div>Dear all,<br>
<br>
I'm having some trouble copying the values from a raster image
(Dartmoor1) to a series of vector points (Contour_points - created from
a contour vector map). When I try to use v.what.rast I get the
following error:<br>
<br>
v.what.rast vector=Contour_points@PERMANENT raster=dartmoor1@PERMANENT
layer=1 column=level<br>
More points (644858) of category 1, value set to 'NULL'<br>
1 categories loaded from table<br>
1 categories loaded from vector<br>
0 categories from vector missing in table<br>
1 duplicate categories in vector<br>
1 records updated<br>
0 update errors<br>
<br>
</div>
</div>
</blockquote>
Looks like all the points in Contour_points have the same cat value.
Check this with:<br>
v.category Contour_points opt=report<br>
<br>
You can add new separate cat values for each point like this:<br>
v.category Contour_points opt=del out=Contour_points_tmp<br>
v.category Contour_points_tmp opt=add out=Contour_points_cats <br>
(get rid of the tmp vector: g.remove vect=Contour_points_tmp)<br>
<br>
Now check:<br>
v.category Contour_points_cats opt=report<br>
<br>
Next setup a column for the rast values:<br>
v.db.addcol Contour_points_cats col="rast_value double" <br>
(Is your raster an integer or float raster??)<br>
And now you should be able to get the raster values into the points
attrib table with:<br>
<br>
v.what.rast Contour_points_cats rast=Dartmoor1 col=rast_value <br>
<br>
<br>
<blockquote type="cite">
<div style="font-family: verdana,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<div><span>I think that this is an attribute table issue. I have
followed the instructions in Example B <a rel="nofollow" target="_blank" href="http://grass.itc.it/grass62/manuals/html62_user/v.what.rast.html">http://grass.itc.it/grass62/manuals/html62_user/v.what.rast.html</a>
but get the following message </span><br>
<br>
v.to.db map=Contour_points option=cat<br>
Reading features...<br>
Updating database...<br>
1 categories read from vector map (layer 1)<br>
1 records selected from table (layer 1)<br>
1 categories read from vector map exist in selection from table<br>
0 records updated/inserted (layer 1)<br>
Record (cat 1) already exists (not inserted)<br>
<br>
I have also tried creating and attaching a new table but get the same
result for v.what.vect. Any ideas welcome, thanks for reading!<br>
<br>
Rebecca<br>
</div>
</div>
<br>
<br>
<br>
This mail was received via Mail-SeCure System.<br>
<pre><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
grass-user mailing list
<a rel="nofollow" class="moz-txt-link-abbreviated" ymailto="mailto:grass-user@lists.osgeo.org" target="_blank" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a rel="nofollow" class="moz-txt-link-freetext" target="_blank" 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">-- <br>Micha Silver<br>Arava Development Co. +972-52-3665918<br><a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://surfaces.co.il">http://surfaces.co.il</a>
</pre>
</div></div>
</div><br>
</body></html>