642 | | A general question in SQL is "How to iterate/compute a value for each pixel of a given raster computing a value based on a table of point?" Can you answer this question? |
| 642 | Why would the point have to be in the raster extent if what you pass to the custom function is the name of a geometry table (or view)?<br> |
| 643 | You don't pass a raster representing the point. How would you do that if you have many point and this is not in accordance with the idea of not converting points to raster.<br> |
| 644 | You pass a raster description based on parameter (similar to ST_AsRaster) or an existing raster and the name of a table (with the schema) and a geometry column (much like in ST_Count but passing a geometry column instead of a raster column) containing the points you want to compute the distance from for every pixels. Those points do not have to be in the raster extent and there can be as many as you want since you will be using the KNN index to find the nearest one.<br> |
| 645 | Generally you won't want to UPDATE an existing raster but rather create a new one based on an existing raster or even better an existing raster coverage. More something like:<br><br> |
| 646 | CREATE TABLE distcoverage AS |
| 647 | SELECT rid, ST_MapalgebraFct(rast, 'euclidean_fct(list of parameters including the table name and column name of the geometry table)'::regprocedure) rast |
| 648 | FROM myexistingcoveragetable<br><br> |
| 649 | We should afet encapsulate the ST_Mapalgebra function with a name and parameter list corresponding to a series of ST_EucledianDistance functions (some taking raster creation parameter, some taking a reference raster). |