[postgis-tickets] [PostGIS] #2341: [raster] ST_MapAlgebra mask parameter
PostGIS
trac at osgeo.org
Thu May 30 10:41:37 PDT 2013
#2341: [raster] ST_MapAlgebra mask parameter
-------------------------+--------------------------------------------------
Reporter: nclay | Owner: dustymugs
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS 2.2.0
Component: raster | Version: trunk
Keywords: |
-------------------------+--------------------------------------------------
Comment(by nclay):
Nulls?
How should we handle null as a double can not be null in c? In my current
code I treat 0 as null for a non-weighted mask, and ignore the possibility
for a null in a weighted mask.
{{{
if ( mask == NULL ) {
values[_y][_x] = npixel[i].value;
nodatas[_y][_x] = 0;
}else{
if( !weighted ){
if( mask[_y][_x] == 0 ){
values[_y][_x] = 0;
nodatas[_y][_x] = 1;
}else{
values[_y][_x] = npixel[i].value;
nodatas[_y][_x] = 0;
}
}else{
values[_y][_x] = npixel[i].value * mask[_y][_x];
nodatas[_y][_x] = 0;
}
}
}}}
What value should be treated as a NULL in the case of a weighted mask? I
am thinking 0, but I want some thought on this or should we have a mask
nodata array?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2341#comment:11>
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