<div dir="ltr">Hi all,<br><br><div>I'm creating a Model to use with r.viewshed from GRASS, just to avoid the manual introduction of the coordinates parameter.</div><div><br></div><div><a href="https://grass.osgeo.org/grass78/manuals/r.viewshed.html">https://grass.osgeo.org/grass78/manuals/r.viewshed.html</a></div><br>So, to get the coordinates from a points layer with just one point 
(viewpoint), I can get the coordinates with this expression (input layer has already etrs89_x and etrs89_y as coordinates fields):<br><br>concat(attributes( get_feature_by_id(@viewpoints, 0))['etrs89_x'], ',', attributes( get_feature_by_id(@viewpoints, 0))['etrs89_y'])<br><br>This works good:<br>r.viewshed input=rast_5eb9d9fb8f9a633 <b>coordinates=88260.003,118942.526</b> observer_elevation=1.6 target_elevation=10 max_distance=5000 refraction_coeff=0.14286 memory=1000 -c -r -b output=output8e7ee6e47dcb4d4fb287eb65c9698cad --overwrite <br><br><br>However, I was trying to give a more generic use to the model, and so I added the 'Add geometry attributes' algorithm to it. With this, I cannot get the coordinates anymore with the expression:<br><br>concat(attributes( get_feature_by_id(@Add_geometry_attributes_OUTPUT, 0))['xcoord'], ',', attributes( get_feature_by_id(@Add_geometry_attributes_OUTPUT, 0))['ycoord'])<br><br>r.viewshed input=rast_5eb9dac74eca034 <b>coordinates=0.0,0.0</b> observer_elevation=1.6 target_elevation=10 max_distance=5000 refraction_coeff=0.14286 memory=1000 -c -r -b output=outputfb2e779533a541c4bbcf2bd6f7773eb1 --overwrite<br><br>They always pass as 0.0,0.0. <br><br>This can be due to the fact that the intermediate result of 'Add geometry attributes' is a memory layer? Is there any possibility of doing this in another way?<br><br><br>Another issue is when I have a points layer with several points (viewpoints). In this case, I tried to use the 'Iterate over this layer' option, but it always get 0.0,0.0 as coordinates. Of course I need some incremental operator get_feature_by_id (I also do not know how yet), but it should work at least to feature id 0, but it does not work. Running it without the Iterate option, it work for the feature id 0.<br><br>Any hints about this?<br><br><div>Here is some sample dataset and the models (the one that is working and the other that has the 'Add geometry attributes' algorithm and doest not work):</div><div><br></div><div><a href="https://cld.pt/dl/download/a2a1a9e0-97d1-4e4d-a0e7-717d5cfcc120/sample_dataset.zip">https://cld.pt/dl/download/a2a1a9e0-97d1-4e4d-a0e7-717d5cfcc120/sample_dataset.zip</a></div><div><br></div><div><a href="https://cld.pt/dl/download/5ba46ec3-3084-45d7-8c3b-6cfe6bac6598/models.zip">https://cld.pt/dl/download/5ba46ec3-3084-45d7-8c3b-6cfe6bac6598/models.zip</a> <br></div><div><br></div><div>Thank you very much!</div><div><br></div><div>Best regards,</div><div>Pedro VenĂ¢ncio<br></div></div>