[GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Margherita Di Leo
Hi, I need to reclassify a vector in the following way: based on a column of type string I have to create a new column of type string based on certain rules that I give upon the first column, and I thought it would be really handy if I could do it like CASE WHEN... THEN ... I have tried to feed

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Zoltan Szecsei
Hi Margherita, I offer my suggestion below as someone who uses varied (and any) product needed to get a job done quickly and correctly. If you are able to open your vector dataset in QGIS (by simply dragging and dropping it into the 'Layer' panel), then take a look at the "Field Calculator"

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Stefan Blumentrath
Ciao Madi, You could use db.execute and do something like: db.execute sql="ALTER TABLE vectormap ADD COLUMN reclass_column TEXT; UPDATE vectormap SET reclass_column = CASE WHEN old_column = ' old value 1' THEN ' new value 1' WHEN old_column = ' old value 2' THEN ' new value 2' WHEN

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Margherita Di Leo
Ciao Stefan, thank you, I tried and it didn't give me any error but didn't update the column either... On Wed, Jun 17, 2020 at 12:16 PM Stefan Blumentrath < stefan.blumentr...@nina.no> wrote: > Ciao Madi, > > > > You could use db.execute and do something like: > > db.execute sql="ALTER TABLE

[GRASS-user] Smoke Plume Model

2020-06-17 Thread Ian
Hi All, Does GRASS has the ability to model smoke plumes especially those with toxic fumes or fallout using Voxels or something similar? Kind Regards Ian ___ grass-user mailing list grass-user@lists.osgeo.org

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Stefan Blumentrath
Here is the documentation for the LIKE operator in SQLite: https://www.sqlitetutorial.net/sqlite-like/ It should be possible to use it in a “searched case statement”: https://www.sqlitetutorial.net/sqlite-case/ So the syntax would be: db.execute sql="UPDATE myroads SET width=CASE WHEN TYPE LIKE

Re: [GRASS-user] Smoke Plume Model

2020-06-17 Thread Veronica Andreo
Hello Ian, I do not know exactly what you refer to by modeling smoke plumes, but indeed GRASS supports 3D raster data as well as time series of 3D raster data or voxels and 3D algebra. Have a look at r3.* and t.rast3d.* modules here https://grass.osgeo.org/grass79/manuals/full_index.html#r3 and

Re: [GRASS-user] Reclassify a vector adding a column

2020-06-17 Thread Margherita Di Leo
Dear Micha, On Wed, Jun 17, 2020 at 4:05 PM Micha Silver wrote: > > On 17/06/2020 16:14, Margherita Di Leo wrote: > > Ciao Stefan, > > thank you, I tried and it didn't give me any error but didn't update the > column either... > > > > The sqlite CASE statement should be: > > CASE WHEN '' THEN