Opened 10 years ago

Closed 10 years ago

#2488 closed defect (fixed)

v.neighbors: "No points found" error while using points map

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Vector Version: svn-releasebranch70
Keywords: v.neighbors Cc:
CPU: Unspecified Platform: Linux

Description

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?

Attachments (3)

points2.png (9.2 KB ) - added by hellik 10 years ago.
v_neighbors_map.jpg (61.4 KB ) - added by neteler 10 years ago.
Example resulting map
points3.png (16.9 KB ) - added by hellik 10 years ago.
example points along

Download all attachments as: .zip

Change History (15)

in reply to:  description ; comment:1 by mlennert, 10 years ago

Replying to 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

comment:2 by neteler, 10 years ago

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.

by hellik, 10 years ago

Attachment: points2.png added

in reply to:  2 comment:3 by hellik, 10 years ago

Replying to 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

in reply to:  1 comment:4 by hellik, 10 years ago

Replying to 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

by neteler, 10 years ago

Attachment: v_neighbors_map.jpg added

Example resulting map

comment:5 by neteler, 10 years ago

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

in reply to:  5 ; comment:6 by mlennert, 10 years ago

Replying to 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 ;-) ).

Moritz

in reply to:  6 comment:7 by hellik, 10 years ago

Replying to mlennert:

Replying to 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 ;-) ).

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 ...

by hellik, 10 years ago

Attachment: points3.png added

example points along

comment:8 by neteler, 10 years ago

Warnings/error code hopefully improved in r62745

in reply to:  8 ; comment:9 by mmetz, 10 years ago

Replying to neteler:

Warnings/error code hopefully improved in r62745

Changed in r62746.

in reply to:  9 ; comment:10 by neteler, 10 years ago

Priority: criticalnormal

Replying to mmetz:

Replying to 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).

in reply to:  10 comment:11 by mmetz, 10 years ago

Replying to neteler:

Replying to mmetz:

Replying to 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.

comment:12 by neteler, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.