[postgis-devel] [PostGIS] #1536: [raster] There should be an option for certain variants of ST_Intersection(raster, raster)
PostGIS
trac at osgeo.org
Mon Feb 6 11:29:05 PST 2012
#1536: [raster] There should be an option for certain variants of
ST_Intersection(raster, raster)
---------------------+------------------------------------------------------
Reporter: pracine | Owner: pracine
Type: defect | Status: new
Priority: low | Milestone: PostGIS 2.0.0
Component: raster | Version: trunk
Keywords: |
---------------------+------------------------------------------------------
Comment(by pracine):
#1537 fixed...
Even if you restraint the extent to the intersection you must do something
for when the provided raster do not have a nodata value defined. If I
intersect a raster having nodata value with a circle, for example, I want
to have some control over the nodata value assigned to the resulting
raster. Doing ST_SetBandNoDataValue() afterward is not sufficient as all
the nodata values, in this case, have been set to 0. I have no other way
than calling ST_MapAlgebraExpr another time to convert all of them to the
nodata value I wish.
As for ST_Clip() ST_Intersection(raster, geometry) should let us provide a
nodata value.
The same logic applies to ST_Intersection(raster, raster). What if I want
the two bands, the second raster has -10 as nodata value, many of then in
the intersecting area and the first raster has no nodata value defined
(and worse many pixel having the value -10)? What should be the nodata
value assigned to the first raster?
I think we should have a parameter for each raster to define the resulting
nodata value. If I don't provide it then ST_MinPossibleValue() should be
used (at the risk of transforming some withdata values into nodata
values).
I think ST_MapAlgebra provides all the tools for ST_Intersection to be
able to define or redefine the nodata value. You have to set those values
using the alternate expressions and then redefine the nodata value with
ST_SetBandNodataValue().
You might say then there should also be a nodata value paramater to
ST_MapAlgebraExpr but no: such a parameter could be conflictual with the
value set with the alternate expressions. It is the role of the caller to
set the nodata value to the same defined with the alternate expressions.
What do you think?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1536#comment:7>
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