[GRASS5] Re: [GRASSLIST:1983] incorrect result from v.what

Eric G. Miller egm2 at jps.net
Wed Jun 20 07:22:25 EDT 2001


On Wed, Jun 20, 2001 at 10:39:55AM +0700, Artemis wrote:
> Hi all,
> 
> I've recently had a problem with v.what when
> querying vector layer from a script.
> 
> When I give v.what the coordinates where no
> lines and no areas are present it still outputs
> something like 'Line - Category 432' or so
> but in only particular parts of my region.
> 
> Maybe this has something to topology support?

The routine that matches a coordinate to a line uses a heuristic whereby
it first checks if the point falls into the bounding box for a given
line.  If the point falls into the bounding box for multiple lines, then
a routine makes sure the closest line is chosen.  Unfortunately, this
probably isn't the best way to do this.  A nearby line may never be
associated with a given point even if that line would be closest because
the point may lie outside the bounding box.  On the contrary, a point
that may be far away from any line, may still be associated with a given
line, iff it lies within the bounding box for that line.

Clearly, it would be better for the routine to take some sort of maximum
distance fuzz factor (probably should be scale dependent) then grow each
bounding box by that distance (so that near-misses don't happen) and
then eliminate lines that are farther than that fuzz factor (so that
far-hits don't happen).

Sort of a bug in the implementation, I guess...  I'll CC this to GRASS
developer's list...

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list