I’m building a QGIS (3.2 Bonn) tool for my colleagues using graphical modeler.
The tool should get 3 inputs: DEM raster layer, vector layer of points, vector layer of a point of interest (POI). The POI should be different each time the user executes the model. One of the processes in the model should be to calculate viewshed using the DEM raster and the POI (vector layer). I saw that the only tool available in QGIS 3 for modeler is GRASS
r.viewshed which gets as input raster DEM and set of xy coordinates to identify the viewing position. Is there a way to insert instead of the xy coordinate the POI, meaning a point layer? or somehow calculate automatically (in the modeler) the xy coordinates of the POI the user choose and then extract the xy information from the layer and insert it to the viewshed tool?
My workaround so far is a bit cumbersome, in the modeler I calculate xy coordinates using
add_geometry_attributes and use the field calculator to concatenate the x,y and insert it to a new field. Then, I manually copy the new field value (e.g., 115.45, -22.455 [EPSG:4326]) and manually paste it in the viewshed tool.
I saw some answers for similar question, but they are relevant to older versions of QGIS, for example this but it uses table parameter that does not exist in QGIS 3 modeler, I also tried this but I can't see the script in the algorithm section in the modeler.
I wrote some basic QGIS tools in the python editor in QGIS 2 but it seems that in the new version things have changed and the is a lack of documentation.