2

I have problems to use the function v.what.vect and I'm not sure what is the issue. I have a simple forest polygon and try to determine if a point is in the forest or not.

# check the output of the feature nature
v.db.select nature col=landuse where="cat<5"
# function returns
landuse
forest
forest
forest
forest
# add column to points
v.db.addcolumn map=points col="landuse varchar(50)"
# use function v.what.vect
v.what.vect map=points column=landuse query_map=nature query_column=landuse
# function returns
Finding nearest features ...
 100%
 100%
Update vector attribute...
 100%
2696 categories - no nearest feature found
v.distance complete. 2696 records updated.

For me its looks like everything worked fine, just the that the result 0 is wired. Any idea what went wrong or how to check it?

enter image description here


EDIT

I checked again the notes of the grass manual:

In case of a multipoint input map map, with several points having the same category number, it can happen, that the query result is NULL, if the same category number falls into different query_map polygons.

But that is also given:

v.db.select points col=cat where="cat<5"
# function output:
cat
1
2
3
4
5

1 Answer 1

2

The problem is that the two features are not matching in the 3rd dimension!

A quick look at the manual give the explanation:

In case that one or both input vector maps are 3D, features need to touch also in the 3rd dimension (z coordinate) in order to transfer attributes.

And the check:

v.info -g nature
# check the top and the bottom
top=0.000000
bottom=0.000000

v.info -g points
# 3rd dimension is given
top=474.388580
bottom=205.511824

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.