[GRASS-dev] [GRASS GIS] #3567: v.select: doubtful result with the default overlap operator selecting areas with lines

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
------------------------------+-------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Keywords: v.select overlap | CPU: Unspecified
Platform: Unspecified |
------------------------------+-------------------------
Trying to select areas with lines, I get a result using the overlap
operator that I don't really understand, and which I suspect being a bug.

Using the following command in the attached location, test_vselect mapset:

{{{
v.select ain=test_polys bin=test_line atype=area btype=line
out=result_overlap op=overlap
}}}

I get a result of only three areas selected (see attached map) where,
IMHO, all 41 should be.

I'll try to diagnose this further when I have the time...

The attached location includes the results of runs with op=intersects,
op=crosses and op=overlaps which provide the results I expect.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------
Changes (by mlennert):

* Attachment "loc_test_vselect.tgz" added.

location with test data in mapset test_vselect

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------
Changes (by mlennert):

* Attachment "v_select_issue_with_overlap_operator.png" added.

image of overlap results

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------
Changes (by mmetz):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"72746" 72746]:
{{{
#!CommitTicketReference repository="" revision="72746"
Vlib: fix with_z = 0 for Vect_line_check_intersection2() and
Vect_line_intersection2(), fixes #3567
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------

Comment (by mmetz):

In [changeset:"72747" 72747]:
{{{
#!CommitTicketReference repository="" revision="72747"
Vlib: fix with_z = 0 for Vect_line_check_intersection2() and
Vect_line_intersection2(), fixes #3567 (backport trunk r72746)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------

Comment (by mmetz):

Replying to [ticket:3567 mlennert]:
> Trying to select areas with lines, I get a result using the overlap
operator that I don't really understand, and which I suspect being a bug.
>
> Using the following command in the attached location, test_vselect
mapset:
>
> {{{
> v.select ain=test_polys bin=test_line atype=area btype=line
out=result_overlap op=overlap
> }}}
>
> I get a result of only three areas selected (see attached map) where,
IMHO, all 41 should be.
>
The problem was not the overlap operator of v.select, but instead that the
vector test_line is 3D, and one of the underlying library functions did
not ignore z as it should have done. This bug has been fixed in trunk and
relbr74 with r72746,7.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------

Comment (by mlennert):

Replying to [comment:3 mmetz]:
> Replying to [ticket:3567 mlennert]:
> > Trying to select areas with lines, I get a result using the overlap
operator that I don't really understand, and which I suspect being a bug.
> >
> > Using the following command in the attached location, test_vselect
mapset:
> >
> > {{{
> > v.select ain=test_polys bin=test_line atype=area btype=line
out=result_overlap op=overlap
> > }}}
> >
> > I get a result of only three areas selected (see attached map) where,
IMHO, all 41 should be.
> >
> The problem was not the overlap operator of v.select, but instead that
the vector test_line is 3D, and one of the underlying library functions
did not ignore z as it should have done. This bug has been fixed in trunk
and relbr74 with r72746,7.

Thanks a lot ! Sorry, should have noticed the 3D nature of the vector
myself. I guess there must have been a message at import which I didn't
see.

This obviously raises the question of whether v.select should always
ignore 3D or whether a flag (-3) should allow enabling it so that if one
wants to check spatial relation in 3D this is possible.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.2
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------

Comment (by mmetz):

Replying to [comment:4 mlennert]:
> Replying to [comment:3 mmetz]:
> > Replying to [ticket:3567 mlennert]:
> > > Trying to select areas with lines, I get a result using the overlap
operator that I don't really understand, and which I suspect being a bug.
> > >
> > > Using the following command in the attached location, test_vselect
mapset:
> > >
> > > {{{
> > > v.select ain=test_polys bin=test_line atype=area btype=line
out=result_overlap op=overlap
> > > }}}
> > >
> > > I get a result of only three areas selected (see attached map)
where, IMHO, all 41 should be.
> > >
> > The problem was not the overlap operator of v.select, but instead that
the vector test_line is 3D, and one of the underlying library functions
did not ignore z as it should have done. This bug has been fixed in trunk
and relbr74 with r72746,7.
>
> Thanks a lot ! Sorry, should have noticed the 3D nature of the vector
myself. I guess there must have been a message at import which I didn't
see.
>
> This obviously raises the question of whether v.select should always
ignore 3D or whether a flag (-3) should allow enabling it so that if one
wants to check spatial relation in 3D this is possible.

This is not possible because `Vect_segment_intersection()` does not
support 3D coordinates.

Also note that 3D topology does not exist yet in GRASS, e.g. a purely
vertical line can cause problems, because it is marked as degenerate at
the corresponding nodes.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3567: v.select: doubtful result with the default overlap operator selecting areas
with lines
--------------------------+------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.1
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.select overlap
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------
Changes (by neteler):

* milestone: 7.4.2 => 7.4.1

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3567#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>