[GRASS-user] Re: Problems with v.what.rast

Rebecca Bennett rabennett at ymail.com
Wed Jun 9 04:32:29 EDT 2010


Hi Micha 

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 
v.category Contour_points_cats opt=report
Layer: 2
type       count        min        max
point     644858          1     644858
line           0          0          0
boundary       0          0          0
centroid       0          0          0
area           0          0          0
all       644858          1     644858
Layer/table: 1/Contour_points_cats
type       count        min        max
point     644858          1     644858
line           0          0          0
boundary       0          0          0
centroid       0          0          0
area           0          0          0
all       644858          1     644858

I added a column v.db.addcol map=Contour_points_cats at PERMANENT layer=1 {columns=rast_value double precision} (as my raster is a float), then ran with error

v.what.rast vector=Contour_points_cats at PERMANENT raster=dartmoor1 at PERMANENT layer=1 column=rast_value

No record for category 553 in table <Contour_points_cats>

No record for category 263 in table <Contour_points_cats>
No record for category 668 in table <Contour_points_cats>

essentially the "No Record" error was repeated lots of times and the tool stopped working.


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)

cheers,
Rebecca



________________________________
From: Micha Silver <micha at arava.co.il>
To: Rebecca Bennett <rabennett at ymail.com>
Cc: grass-user at lists.osgeo.org
Sent: Tue, 8 June, 2010 17:57:57
Subject: Re: [GRASS-user] Problems with v.what.rast

On 06/08/2010 05:39 PM, Rebecca Bennett wrote: 
> 
>Dear all,
>
>>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:
>
>>v.what.rast vector=Contour_points at PERMANENT raster=dartmoor1 at PERMANENT
>layer=1 column=level
>>More points (644858) of category 1, value set to 'NULL'
>>1 categories loaded from table
>>1 categories loaded from vector
>>0 categories from vector missing in table
>>1 duplicate categories in vector
>>1 records updated
>>0 update errors
>
>
Looks like all the points in Contour_points have the same cat value.
Check this with:
v.category Contour_points opt=report

You can add new separate cat values for each point like this:
v.category Contour_points opt=del out=Contour_points_tmp
v.category Contour_points_tmp opt=add out=Contour_points_cats 
(get rid of the tmp vector: g.remove vect=Contour_points_tmp)

Now check:
v.category Contour_points_cats opt=report

Next setup a column for the rast values:
v.db.addcol Contour_points_cats col="rast_value double" 
(Is your raster an integer or float raster??)
And now you should be able to get the raster values into the points
attrib table with:

v.what.rast Contour_points_cats rast=Dartmoor1 col=rast_value 



I think that this is an attribute table issue. I have
>followed the instructions in Example B http://grass.itc.it/grass62/manuals/html62_user/v.what.rast.html >but  get the following message 
>
>>v.to.db map=Contour_points option=cat
>>Reading features...
>>Updating database...
>>1 categories read from vector map (layer 1)
>>1 records selected from table (layer 1)
>>1 categories read from vector map exist in selection from table
>>0 records updated/inserted (layer 1)
>>Record (cat 1) already exists (not inserted)
>
>>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!
>
>>Rebecca
>
>
>
>>This mail was received via Mail-SeCure System.
>
>
>_______________________________________________
>grass-user mailing list
>grass-user at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
>
>This mail was received via Mail-SeCure System.
>
>
>  


-- 
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il 



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100609/3a92cbde/attachment.html


More information about the grass-user mailing list