[GRASS-user] Raster boxplots selection

Paulo van Breugel p.vanbreugel at gmail.com
Wed Aug 7 03:58:36 PDT 2024


On Wed, Aug 7, 2024 at 11:00 AM sibylle via grass-user <
grass-user at lists.osgeo.org> wrote:

> Dear coummunity
>
>
>
> I am wondering if my code for selecting specific raster points (e.g.
> squares, Quadrate) has a bug. I do not want to plot all squares, because I
> still have not yet data for all squares.
>
>
>
> v.extract quadrat out=quadrat_3 where="ID_Quadrat=527190 and
> ID_Quadrat=569228 and ID_Quadrat=581166" --o
>
>
>
The where statement will result in no quadrats selected. Use 'or' instead
of 'and':

v.extract quadrat out=quadrat_3 where="ID_Quadrat=527190 or
ID_Quadrat=569228 or ID_Quadrat=581166" --o

This will give you the three quadrats (or the quadrats that have those IDs,
in case there are more quadrats with the same ID).

The resason is that I get an error on the next line
>
>
>
> v.to.rast quadrat_3 out=quadrat_3 use=attr attribute_column=ID_Quadrat
> --o
>
> ERROR: Database connection not defined for layer <1>
>
>
>
> Full Code:
>
> r.import input=allema_LZall_UAA_pres_merged.tif output=al_pres --o
>
> g.region -ap rast=al_pres
>
> v.import input=untersuchungsquadrate_2020_2024.gpkg output=quadrat --o
>
> v.info -g quadrat
>
>
>
> v.extract quadrat out=quadrat_3 where="ID_Quadrat=527190 and
> ID_Quadrat=569228 and ID_Quadrat=581166" --o
>
> v.to.rast quadrat_3 out=quadrat_3 use=attr attribute_column=ID_Quadrat --o
>
> r.boxplot -o input=al_pres zones=quadrat_3 output="al_pres_boxplot_3.png"
> raster_statistics=median –o
>
>
>
> Thanks a lot
>
> Sibylle
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20240807/80384a28/attachment.htm>


More information about the grass-user mailing list