Wednesday, 24 April 2019

interpolation - How do you use GRASS's v.kernel?


I am flummoxed on how to use GRASS's v.kernel.


I have a vector layer of around 2.5 million points. I want to make a heat map using v.kernel to show concentrations, since I have variable instances with overlapping points, sometimes huge overlaps.


I've already gotten this vector layer in GRASS, and it displays just fine.



I've tried using GRASS's v.kernel command based on what I've seen here and on other forums, and I can't get it to do anything besides output a raster that's just a pink square.


Here's the command I'm using:


v.kernel --verbose input=master_grass7 output=master_grass7a_heatmap stddeviation=.0001

I've varied the stddeviation to all sorts of values from 1000000 to .000001, and it had no effect.


I've read the v.kernel documentation repeatedly and don't really understand what it's getting at. At least, the instructions are on esoteric concepts, nothing practical. I've also checked the source code, and I'm not really understanding it, either. Yes, I can read C. The problem is it depends on a lot of stuff defined elsewhere in GRASS GIS.


I've also done a lot of Google searching, and I can't find a comprehensive guide. All that I'm getting are scattered copies of the v.kernel doc/man page or people who apparently got it to work without a fuss.


I've also checked up on the concept of kernel density estimation (KDE), and even then I don't see how to use the v.kernel command. That command appears to be a specific interpretation of KDE; its switches don't appear to correspond well to generic KDE concepts.


So back to the main question here: how can someone who is not intimate with GRASS product development use the v.kernel command? Is there a plain language translation available?



Answer




The v.kernel algorithm calculates the density of vector points for each cell of a raster map. If you so far have only been using vector objects, chances are that you have not set up your region (which not only defines the extents, but also the raster resolution) adequately: You probably have your region set to only one row and one column, which means the v.kernel algorithm will only compute the kernel density as a single value over the whole map. A region setting like this is fine if you do not use any raster maps, because the vector maps don't care about the resolution settings. Check your region settings using g.region -p, and if rows and cols is set to 1, increase the resolution by using


g.region rows= cols=

or


g.region res=

where is the length of a resolution cell in map units.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...