0

I am using the latest GRASS Gis and QGis versions.

In order for a study project, I have to rasterise a vector layer using v.to.rast. This has to be done in my already existing shell script, in which there are various other commands, for instance "mkdir" in order to create folders or ogr2ogr commmands.

Unfortunately, these two commands dont work in my general shell script, only in the grass gis cmd, which opens by opening grass gis.

Is there some command missing, like for opening Grass Gis or creating a new location? If so, how exactly is the command called?

Unfortunately these two commands dont work:

v.import input="E:\Universitaet\WS 2020 - 2021\Seminar GIS\Gruppenarbeit\Dateien\\Vegetation\Irrelevant_data_deleted\vegetation_two_columns.dbf"

v.to.rast input="vegetation_two_columns.dbf" output="E:\Universitaet\WS 2020 - 2021\Seminar GIS\Gruppenarbeit\Dateien\Wildfireanalysis\Vegetation\Rasterised\Vegetation_Santa-Cruz_rasterised"

Thanks in advance!

Unfortunately, the GDAL command Rasterise (vector ro raster) is no option either, since it doesnt allow string variables.

2

GRASS modules and any of its functionality cannot be accessed without accessing a proper GRASS environment. Using GRASS (or any of its modules) without starting it explicitly can be done in mainly 3 ways:

  1. In a standalone python script
  2. In bash or windows command line (your case)
  3. In a standalone R script

The beauty of accessing GRASS in these ways is you can use all the power of GRASS along with the additional functionality of scripting.

Each of these methods has a series of steps that you can follow from this GRASS wiki. This is a great place to start with multiple working examples to try. If you face any trouble, please come back with a sample script and any relevant error message(s) you receive. Happy to help with that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.