<div dir="ltr">Thanks, it worked.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:12.8px"><b>Regards,</b></div><div style="font-size:12.8px"><b>Ang Dawa Sherpa</b></div><div style="font-size:12.8px"><b>GIS technician - Irrigation Master Plan</b></div><div style="font-size:12.8px"><b>WRPPF - DOI, Nepal Government</b></div><div style="font-size:12.8px"><b>Lalitpur</b></div><div style="font-size:12.8px"><b>contact: 984 007 3861</b></div></div></div></div>
<br><div class="gmail_quote">On Thu, Mar 16, 2017 at 6:22 PM, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 16/03/17 12:36, Ang Sherpa wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello users,<br>
<br>
Is it possible to query according to coordinates and return the value of<br>
desired column from attribute table as result.<br>
<br>
v.what allows to query the map, however, could not figure out how to<br>
choose the column in attribute table.<br>
<br>
Eg. In a world shape fileĀ  having "population" as one of its column in<br>
attribute table.<br>
when 25.36258,85.236554 is entered in coordinates then it should return<br>
the population of that country in which the given coordinates belongs to.<br>
<br>
Any help will be much appreciated.<br>
</blockquote>
<br></span>
It depends on the language in which you are working.<br>
<br>
In a bash shell, using the NC demo dataset, here's how you can get the name of a specific county which is in the NAME column of the attribute table:<br>
<br>
eval $(v.what -ga boundary_county coordinates=498364.930178,2291<wbr>63.426556)<br>
echo $NAME<br>
<br>
In python, you can use parse_command to get a dictionary of results:<br>
<br>
result = gscript.parse_command('v.what'<wbr>, flags='ga', map='boundary_county', coordinates=[498364.930178,229<wbr>163.426556])<br>
result['NAME']<span class="HOEnZb"><font color="#888888"><br>
<br>
Moritz<br>
</font></span></blockquote></div><br></div>