[GRASS-user] [Getting name of country based on coordinates]

Thanks,

v.what seems to fulfill my objective. However, I am still trying to figure out that how to save its output in variable. Actually, I was developing Grass Gis based app. If I could save the result in variable then I could use for further anlysis. Any idea?

Thanks,

···

On Thu, Mar 16, 2017 at 12:26 PM, <maodonovan@gmail.com> wrote:

Perhaps I misunderstood:

If you using a map of the points then v.what.vect will upload the features (after you have created a variable to hold the details).
If you are not using a point file and a display (wx?) then select the country layer and click on the point location to show the details.

Mail sent from maodonovan@gmail.com’s personnal www.uStart.org page.

From : Ang Sherpa <angsherpa232@gmail.com>
Date : 08:23
Subject : Re: [GRASS-user] [Getting name of country based on coordinates]
To : maodonovan@gmail.com,GRASS user list <grass-user@lists.osgeo.org>

Thanks.
In v.what.vect I don’t see anywhere to enter the coordinates.
Eg: 28.325625 and 85.3256225

Best,
Ang Dawa Sherpa

Best,
Ang Dawa Sherpa

On Thu, Mar 16, 2017 at 11:55 AM, <maodonovan@gmail.com> wrote:

use v.what.vect

Mail sent from maodonovan@gmail.com’s personnal www.uStart.org page.

From : Ang Sherpa <angsherpa232@gmail.com>
Date : 07:57
Subject : [GRASS-user] [Getting name of country based on coordinates]
To : GRASS user list <grass-user@lists.osgeo.org>

Hi all,

Is there a way to query or get the name of the country from attribute table of country polygons when users enter the coordinates.For an eg. when the user enter the any random coordinates that belongs to China then the grass gis reads the attributes of polygons of countries and gives a China as output.

Thanks in advance.

Best,
Ang Dawa Sherpa

On Thu, Mar 16, 2017 at 8:29 AM, Ang Sherpa <angsherpa232@gmail.com> wrote:

Thanks,

v.what seems to fulfill my objective. However, I am still trying to figure
out that how to save its output in variable. Actually, I was developing
Grass Gis based app. If I could save the result in variable then I could
use for further anlysis. Any idea?

See the manual: -g

GRASS 7.2.1svn (nc_spm_08_grass7):~ > v.what zipcodes_wake
coordinates=637502.25,221744.25 -g
East=637502.25
North=221744.25

Map=zipcodes_wake
Mapset=PERMANENT
Type=Area
Sq_Meters=130875884.223
Hectares=13087.588
Acres=32340.135
Sq_Miles=50.5315
Layer=1
Category=40

This output is easy to parse.

HTH,
Markus

On Sun, Apr 2, 2017 at 5:53 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Thu, Mar 16, 2017 at 8:29 AM, Ang Sherpa <angsherpa232@gmail.com> wrote:

Thanks,

v.what seems to fulfill my objective. However, I am still trying to figure
out that how to save its output in variable. Actually, I was developing
Grass Gis based app. If I could save the result in variable then I could
use for further anlysis. Any idea?

See the manual: -g

GRASS 7.2.1svn (nc_spm_08_grass7):~ > v.what zipcodes_wake
coordinates=637502.25,221744.25 -g
East=637502.25
North=221744.25

Map=zipcodes_wake
Mapset=PERMANENT
Type=Area
Sq_Meters=130875884.223
Hectares=13087.588
Acres=32340.135
Sq_Miles=50.5315
Layer=1
Category=40

This output is easy to parse.

or use a Python wrapper around v.what, function vector_what():
https://grass.osgeo.org/grass73/manuals/libpython/script.html#script.vector.vector_what

Anna

HTH,
Markus
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user