[postgis-devel] [PostGIS] #903: [raster] ST_Reclass
PostGIS
trac at osgeo.org
Mon Apr 18 17:22:28 PDT 2011
#903: [raster] ST_Reclass
----------------------------+-----------------------------------------------
Reporter: dustymugs | Owner: dustymugs
Type: task | Status: assigned
Priority: medium | Milestone: PostGIS Raster Future
Component: postgis raster | Version: trunk
Keywords: |
----------------------------+-----------------------------------------------
Comment(by dustymugs):
In writing ST_Reclass, I noticed there was an inherent weakness regarding
the user defining a nodata value for the reclassified band. As such, I
believe the new type "reclassarg" needs to be expanded:
{{{
CREATE TYPE reclassarg AS (
nband int,
reclassexpr text,
pixeltype text,
nodataval double precision
);
}}}
By specifying a nodata value, ST_Reclass can automatically existing nodata
values to the new nodata value and allows the reclassexpr to convert other
values to the nodata value.
Also, ST_Reclass should have several variations.
1. ST_Reclass(rast raster, VARIADIC reclassargset reclassarg[])
The default function
2. ST_Reclass(rast raster, nband int, reclassexpr text, pixeltype text,
nodataval double precision)
Convert a single band instead of a set of parameters rather than using
reclassarg
{{{
ST_Reclass(rast, 1, '0-100:1-10, 101-500:11-150,501 - 10000: 151-254',
'8BUI', 255)
}}}
3. ST_Reclass(rast raster, nband int, reclassexpr text, pixeltype text)
New band has no nodata value unlike in !#2
{{{
ST_Reclass(rast, 1, '0-100:1-10, 101-500:11-150,501 - 10000: 151-254',
'8BUI')
}}}
4. ST_Reclass(rast raster, reclassexpr text, pixeltype text)
Assume band index is 1 and has no nodata value
{{{
ST_Reclass(rast, '0-100:1-10, 101-500:11-150,501 - 10000: 151-254',
'8BUI')
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/903#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-devel
mailing list