[GRASS-dev] [GRASS GIS] #2488: v.neighbors: "No points found" error while using points map

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
The functionality of v.neighbors is a bit obscure to me:

{{{
GRASS 7.1.svn (nc_spm_08_grass7):~ > g.region rast=zipcodes -p res=500
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 500
ewres: 500
rows: 27
cols: 30
cells: 810

GRASS 7.1.svn (nc_spm_08_grass7):~ > v.neighbors input=schools_wake \
output=schools_wake_500m method=count size=3 --o
  100%
WARNING: No points found

GRASS 7.1.svn (nc_spm_08_grass7):~ > v.info -t schools_wakenodes=0
points=167
lines=0
boundaries=0
centroids=0
areas=0
islands=0
primitives=167
map3d=0
}}}

Is the module not working or is the use case wrong?

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mlennert):

Replying to [ticket:2488 neteler]:
> The functionality of v.neighbors is a bit obscure to me:
>
> {{{
> GRASS 7.1.svn (nc_spm_08_grass7):~ > g.region rast=zipcodes -p res=500
> projection: 99 (Lambert Conformal Conic)
> zone: 0
> datum: nad83
> ellipsoid: a=6378137 es=0.006694380022900787
> north: 228500
> south: 215000
> west: 630000
> east: 645000
> nsres: 500
> ewres: 500
> rows: 27
> cols: 30
> cells: 810
>
> GRASS 7.1.svn (nc_spm_08_grass7):~ > v.neighbors input=schools_wake \
> output=schools_wake_500m method=count size=3 --o
> 100%
> WARNING: No points found
>
> GRASS 7.1.svn (nc_spm_08_grass7):~ > v.info -t schools_wakenodes=0
> points=167
> lines=0
> boundaries=0
> centroids=0
> areas=0
> islands=0
> primitives=167
> map3d=0
> }}}
>
> Is the module not working or is the use case wrong?µ

IIUC, the module searches around the cell centers with a radius = size/2,
so I guess your size parameter is just way to small for the use case. But
only guessing here.

Moritz

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Right, I get some (unclear to me) result using:

{{{

}}}

In r62733 I tried to add a more informative error message.

The scope of the module remains unclear to me. At least the updated
example (r62734) now generates a map.

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [comment:2 neteler]:
>
> The scope of the module remains unclear to me. At least the updated
example (r62734) now generates a map.

I've added a screenshot.

AFAIU, e.g.

- a point vector
- a search radius has to be given
- the module writes a raster map; the cell value of the raster map is the
count how many points are within the search radius in this raster cell; in
the screenshot yellow means count = 1, i.e. there is only 1 vector point
within the search radius; red means count = 2, i.e. there are 2 vector
points within the search radius.

HTH

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [comment:1 mlennert]:
>
> IIUC, the module searches around the cell centers with a radius =
size/2, so I guess your size parameter is just way to small for the use
case. But only guessing here.
>
> Moritz

yes, it seems so that the search radius is half of the neighborhood
diameter=size

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

I have added another screenshot. What it does I can see but why?
The "half moons" are not particularly useful...

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mlennert):

Replying to [comment:5 neteler]:
> I have added another screenshot. What it does I can see but why?
> The "half moons" are not particularly useful...

Juste brainstorming here, but I could imagine that this module could be
useful when you are using kernel-based techniques and you have to decide
on a kernel radius. Running v.neighbors first with varying radius sizes
allows you to get an idea of how many points you will use on average for
determining the value of each pixel.

Another idea: assuming you have 360° antennas and a known reach of these
antennas you can quickly get a gross estimate of intensity of coverage,
e.g. for identifying (very roughly) zones with higher levels of
electromagnetic radiation. (And yes, I know that this will be pretty much
nonsense, unless you are in a completely flat, unbuilt area :wink: ).

Moritz

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by hellik):

Replying to [comment:6 mlennert]:
> Replying to [comment:5 neteler]:
> > I have added another screenshot. What it does I can see but why?
> > The "half moons" are not particularly useful...
>
> Juste brainstorming here, but I could imagine that this module could be
useful when you are using kernel-based techniques and you have to decide
on a kernel radius. Running v.neighbors first with varying radius sizes
allows you to get an idea of how many points you will use on average for
determining the value of each pixel.
>
> Another idea: assuming you have 360° antennas and a known reach of these
antennas you can quickly get a gross estimate of intensity of coverage,
e.g. for identifying (very roughly) zones with higher levels of
electromagnetic radiation. (And yes, I know that this will be pretty much
nonsense, unless you are in a completely flat, unbuilt area :wink: ).
>
> Moritz

thinking of the savanna with sparsely scattered trees and animals living
on the trees and a certain activity radius; do quick check how much
competition between the several individuals by v.neighbourhood ...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2488#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Warnings/error code hopefully improved in r62745

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2488#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mmetz):

Replying to [comment:8 neteler]:
> Warnings/error code hopefully improved in r62745

Changed in r62746.

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * priority: critical => normal

Comment:

Replying to [comment:9 mmetz]:
> Replying to [comment:8 neteler]:
> > Warnings/error code hopefully improved in r62745
>
> Changed in r62746.

Thanks, backported in r62749.

Yet to find: a reasonable example for the manual page (ideally based on
the NC dataset).

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

#2488: v.neighbors: "No points found" error while using points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.neighbors | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mmetz):

Replying to [comment:10 neteler]:
> Replying to [comment:9 mmetz]:
> > Replying to [comment:8 neteler]:
> > > Warnings/error code hopefully improved in r62745
> >
> > Changed in r62746.
>
> Thanks, backported in r62749.
>
> Yet to find: a reasonable example for the manual page (ideally based on
the NC dataset).

The example looks reasonable to me. It gives for each grid cell the number
of points (here: schools) not farther than 1500 meter away from the cell
center.

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

#2488: v.neighbors: "No points found" error while using points map
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Resolution: fixed | Keywords: v.neighbors
  Platform: Linux | Cpu: Unspecified
----------------------+-----------------------------------------------------
Changes (by neteler):

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

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