TransWikia.com

GRASS GIS 7.8 trigometric function of vector attribtue

Geographic Information Systems Asked on April 23, 2021

I need to calculate the sin and cos of a vector attribute column, but these functions do not appear to be available. In Python I’ve tried using v.db.update:

gscript.run_command('v.db.update', map='orientation', column='Z', query_column='COS(AZIMUTH)')

but this was unsuccessful. Does anyone have recommendations?

One Answer

The problem is that SQLite by default lacks log(), sqrt(), cos(), and other functions. To overcome this limitation you need an addition to SQLite for this: the "SQLite extended functions".

Please check the v.to.db manual page for it in the section Updating of columns with on the fly calculation (SQLite extended functions).

It provides two links (for Linux and Windows) explaining how to compile this library/DLL yourself.

Correct answer by markusN on April 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP