[GRASS-user] Calculation with attributes of point file
Johannes Radinger
JRadinger at gmx.at
Tue May 17 14:45:20 EDT 2011
Am 17.05.2011 um 16:14 schrieb Moritz Lennert:
> On 16/05/11 16:32, Johannes Radinger wrote:
>> Hallo,
>>
>> I've got a point file and populated (v.what.rast) it with values
>> from a flow direction raster (flow direction from r.watershed).
>>
>> I want to use these values to rotate the symbol in ps.map but
>> therefore I've to recalulcate the values in the direction-column
>> of the point file (x*45+90 or so).
>>
>> How can that be done? I thought about v.reclass but don't really
>> know how?!
>>
>> Another option would be to access the sqlite database and perform
>> the calculation there (I am working in a python script) like:
>> database = sqlite3.connect(os.path.join(gisdbase, location,
>> mapset, 'sqlite.db'))
>> db = database.cursor()
>> db.execute .... but what is the correct command for calculation
>> within a database??
>>
>> Probably it is easier than I think... :)
>
> If you want to modify an existing column:
>
> v.db.update col=YourExistingColumn value=YourCalculation
>
> If you want to create a new column:
>
> v.db.addcolumn col="YourNewCol double precision"
> v.db.update col=YourNewCol value=YourCalculation
Thank you that was what I was looking for...
/j
>
> Moritz
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
More information about the grass-user
mailing list