query vector points x,y [was: Re: [GRASS-dev] Two kind questions...]

Maciej Sieczka tutey at o2.pl
Thu Sep 21 05:36:57 EDT 2006


Damiano Triglione wrote:
>>> On Wed, 2006-09-20 at 20:44 +0200, Damiano Triglione wrote:

>>>> 2. How can I list the (east,north) coordinate together with the
>>>> attributes
>>>> of a given vector points file? With v.out.ascii I can see
>>>> coordinates and
>>>> category; with db.select I can see category and decimal attributes;
>>>> but how
>>>> can I see all the information in a joint way?

Maciej Sieczka wrote:

>> v.db.addcol to add columns x,y
>> v.to.db to upload coordinates to x,y colums
>> db.select to list cat with x,y attributes
>>
>> Is there a simpler way?

> Thank you! Maybe a simpler way could be a grass module that performs the
> actions above! Or a module that shows all the information without adding
> the x,y columns (this would have the purpose to not increase the size of
> the files stored in the hard disk with redundant information).

Ha, it shows v.to.db can be used with dummy column names in the 'print
only' mode - no need to alter your data then, eg.:

v.to.db -p map=points type=point,centroid option=coor
column=dummy_x,dummy_y

I'll document it.

For single queries, maybe d.what.vect and v.what could be extended to
report points and centroids coordinates? Currently, for lines their
lenght is reported, for areas their area. For point features we often
want to know their coordinates and it would a good feature. Any
programmer interested?

d.what.vect and v.what already report X,Y, but these are the
coordinates of where one clicks, not the real coordinates of a point
feature...

Maciek




More information about the grass-dev mailing list