[GRASS-dev] new flag to interpolate from nearby raster cells for v.what.rast
Hamish
hamish_b at yahoo.com
Thu Nov 14 02:15:23 PST 2013
Hi,
I just added in the dev branches two new flags for v.what.rast. The first
is a flag to print the query results to stdout instead of updating a
table, since for a large vector points map the table update is
effectively unusable unless you let it run overnight (bug #2131).
The second flag changes the default containing-grid-cell method to a
weighted avg. of the 4 nearest raster cell centers (IDW). The search radius
is not very big, which does lead to some cell edge artifacts if you look
closely, but it runs almost at the same speed as the nearest-neighbour
query and is not overly complicated, so I'd hope "good enough". See the
attached screenshot and try to spot the flaws (becomes obvious in NVIZ).
This is mostly useful when going from a very coarse resolution raster map
to a very dense set of vector points and you want to avoid large steps in
value at the cell edges. A common occurrence of this is going from world
or continental scale climatic or weather raster data -> input to a local
finite element mesh-grid*, and the big jumps in value risk causing
shockwaves or other unpleasant effects in the physics of the finite
element model.
[*] e.g. see "Gmsh" http://geuz.org/gmsh/gallery/MURUROA.png
The same technique could be applied to r.what if there was the need, Radim
adapted the v.what.rast module from it so the code bases are pretty similar.
The method seems to work pretty well, but I'd welcome a better coder than
myself to continue improving it. I considered parallelizing it with OpenMP,
but it will run through a million points in ~4 seconds, so perhaps not
worth the trouble. Another idea is to allow it to work without topology,
so fast raster querying from massive point swarms (e.g. lidar).
please test!
enjoy,
Hamish
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.what.rast_interp.png
Type: image/png
Size: 79876 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20131114/71a50979/attachment-0001.png>
More information about the grass-dev
mailing list