[GRASS-user] Query vector type has problems

Anna Petrášová kratochanna at gmail.com
Sun Sep 6 18:58:20 PDT 2015


Hi,

On Fri, Aug 28, 2015 at 8:54 AM, Andres Kuusk <andres at to.ee> wrote:

>
>
> Dear Anna Petrášová,
>
> Thank you for your quick response. I am sorry for being so late in testing
> your suggestions, I had my vacation.
>
>
> Vector commands v.what.vect and v.distance do not fill the attribute
>>> column of a point vector.
>>>
>>> [..]
>
>>
>>> The command
>>>
>>> v.what.vect map=vpoints column=aid query_map=varea query_column=aid
>>>
>>> returns:
>>>
>>> Finding nearest features...
>>> Update vector attributes...
>>> 191 categories - no nearest feature found
>>>
>>>
>> I tried similar example, but it seems to work for me, perhaps you could
>> send us reproducible example which uses North Carolina sample datatset?
>>
>
> I did not mention that I am using Postgres database.
> Anyway, now I tested v.what.vect so that I exported vectors 'geology' and
> 'schools' from the NC GRASS 7 subset using ESRI_Shapefile format.
> Then I created Postgres DB 'nc_basic', connected to the DB and imported
> these two vectors, added column 'geology' to the table 'schools', and
> updated the attribute 'geology'. Everything works fine.
>
> Now I exported my test vectors 'stand' (area, 1 polygon) and 'samples'
> (191 points) from my location/mapset using ESRI_Shapefile format and
> imported to the nc_basic_spm_grass7/user1 mapset.
>
> v.what.vect --verbose map=samples at user1 column=idr_id
> query_map=stand at user1 query_column=idr_id
> Finding nearest features...
> Update vector attributes...
> 191 categories - no nearest feature found
> 191 categories read from the map
> 191 categories exist in the table
> 191 categories read from the map exist in the table
> v.distance complete. 191 records updated.
>
> Attached you will find the tar-file of these vectors in the ESRI Shapefile
> format and the screenshot of these data in the nc_basic_spm_grass7/user1
> mapset.
>
> Could it be that some colum-names are too long in the attribute tables?
>

it took me a while to figure out the problem, but it's because your samples
are 3D and the stand vector is not. If you convert the samples to 2d with
v.to.3d, then it will work.

Cheers,

Anna

>
>
> With best wishes,
>
> Andres
>
>
> ----------------
>
>
>>> The OS is OpenSUSE-13.1, 3.11.10-25-desktop, x86_64.
>>> The problem is there in:
>>>
>>> GRASS-7.0.0-2.42 from the repository
>>> http://download.opensuse.org/repositories/Application:/Geo/openSUSE_13.1
>>>
>>> GRASS-7.1 SVN r65785M
>>> (GRASS GIS 7.1.svn r65785M compilation log: No errors detected.)
>>>
>>> GRASS-7.0 SVN r58582.
>>>
>>> An old svn-version of 7.0 did the work (r51370):
>>> v.what.vect ...
>>> Finding nearest feature..
>>> Finding nearest areas...
>>> Update vector attributes...
>>> 2837 categories - no nearest feature found
>>> 23679 categories read from the map
>>> 23679 categories exist in the table
>>> 23679 categories read from the map exist in the table
>>> v.distance complete. 23679 records updated.
>>>
>>> 20842 points have got the attribute.
>>>
>>>
>>> Andres Kuusk
>>> Tartu Observatory, Estonia
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150906/a9ba153d/attachment.html>


More information about the grass-user mailing list