[postgis-tickets] [PostGIS] #2603: [raster] Add docs for ST_MapAlgebra with mask parameter
PostGIS
trac at osgeo.org
Mon Oct 5 11:52:51 PDT 2015
#2603: [raster] Add docs for ST_MapAlgebra with mask parameter
------------------------+---------------------------
Reporter: dustymugs | Owner: dustymugs
Type: task | Status: new
Priority: critical | Milestone: PostGIS 2.2.0
Component: raster | Version: trunk
Resolution: | Keywords:
------------------------+---------------------------
Comment (by robe):
Ah okay I think I'm getting it now. I kept on thinking it was being
applied after the mapalgebra call. So should the mask always be 0s and 1s?
I'm not sure that behavior works right because when I gave it a 5x5 matrix
it complained dimension was not the same as neighbor (that's why I
augmented the error message to see what it thought was wrong). That's
what I had thought that the distance was inferred from the matrix.
Here is an example:
{{{
DROP TABLE IF EXISTS shapes;
CREATE TABLE shapes(rid integer, rast raster);
INSERT INTO shapes(rid,rast)
VALUES ( 1, ST_AsRaster(
ST_Buffer(
ST_GeomFromText('LINESTRING(50 50,150 150,150
50)'), 10,'join=bevel'),
200,200,ARRAY['8BUI'], ARRAY[118], ARRAY[0]) );
SELECT st_mapalgebra(rast,1,'st_mean4ma(double precision[], int[],
text[])'::regprocedure,'{{1,0,1,1,1}, {1,0,1,1,1}, {1,0,1,1,1},
{1,0,1,1,1}, {1,0,1,1,1}}'::double precision[],false)
FROM shapes;
}}}
Gives me:
{{{
ERROR: rt_pixel_set_array: mask dimensions 5 x 5 do not match given dims
3 x 3
}}}
Why doesn't the distancex/y become 2,2?
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/2603#comment:10>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list