<div dir="ltr"><div><div><div><div><div>The answer may depend on the coverage of points you have.<br><br></div><div>1.) full postgis<br></div>If you have a lot of points (meaning few hex without data), you can simply try to give the 0 hex a value following a function of the value of the neighbours.<br>
<br></div>For instance, take the N nearest neighbour (called NN) that have a value!=0 along with there distance to the 0 hex, then update the 0 hex with average value of NN weighted with the distance.<br><br></div><div>2.) Postgis+PL/R<br>
</div>If you have very few point it should be easier to use PL/R to perform krigging on your point, thus giving you<br>_ a 2D grid with value for each cell. Then you transfer the value from grid to hex by simple intersection.<br>
</div>_a mathematical function that for a given X,Y return a value. You just have to evaluate it for every hex.<br></div>(the krigging output depends on what you uses in R)<br><div><div><br></div><div>3.)Postgis+Grass (which must be binded to R)<br>
</div><div>grass gives access to kriging methods. This allow you to avoid installing pl/R<br></div><div><br></div><div>Cheers,<br>RĂ©mi-C<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-01 14:26 GMT+02:00 Dave Barter <span dir="ltr"><<a href="mailto:dave.barter@gmail.com" target="_blank">dave.barter@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:18px;background-color:rgba(248,248,248,0.6)">
I have a table of tessellated hexagons that I created as a hex binning grid to cover an area.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:18px;background-color:rgba(248,248,248,0.6)">
I've then overlaid a point set to give some of the hexagons a value. The shapes with value "0" have no value and I'd like to interpolate these from the values of the neighbours (ie. as per Kriging or other algorithm). How can I accomplish this in postgis given my table looks like:-</p>
<pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:12px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;word-wrap:normal;color:rgb(51,51,51);line-height:18px;background-color:rgb(238,238,238)">
<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(34,34,34);white-space:inherit">hex_grid_data
(
 gid SERIAL,
 wkb_geometry (geometry),
 value INTEGER
)</code></pre></div><br><div><div style="font-family:helvetica,arial;font-size:13px"><br></div></div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>