[postgis-users] ST_Reclass - oposit direction in reclass

Stanislav Vanecek S.Vanecek at dhi.cz
Fri Dec 16 04:07:29 PST 2011


Hi -bborie
 Thank you. It working properly now
Standa

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Bborie Park
Sent: Tuesday, December 13, 2011 10:21 PM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] ST_Reclass - oposit direction in reclass

Hey Standa,

It looks like the high to low output range was causing issues with the 
code.  So, please try r8393 where I've added a check for the range 
direction.

My test query of

{{{
WITH foo AS (
	SELECT ST_AddBand(
		ST_MakeEmptyRaster(10, 10, 0., 0., 1., -1., 0, 0, 0),
		'8BUI', 100., 0
	) AS rast
)
SELECT
	ST_Reclass(rast, 1, '1-100]:100-1', '8BUI', 0)
FROM foo
}}}

does as expected where the value 100 is set to 1 in the output raster.

-bborie

On 12/13/2011 12:11 AM, Stanislav Vanecek wrote:
> Hi Bborie
> The SQL is
> SELECT
ST_AsTIFF(ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(rast),ST_R
eclass(rast,1, '0-2115):255-0'::text,
'8BUI'::text,0)),ST_Reclass(rast,1, '0-2115):255-0'::text,
'8BUI'::text,0)),ST_Reclass(rast,1, '0-2115):255-0'::text,
'8BUI'::text,0))
> And in this case the result is white rectangle
> What I am doing wrong?
> Best regards
> Standa
>
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Bborie Park
> Sent: Monday, December 12, 2011 4:41 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] ST_Reclass - oposit direction in reclass
>
> On Mon, Dec 12, 2011 at 6:42 AM, Stanislav Vanecek<S.Vanecek at dhi.cz>
wrote:
>> Hi
>>   I am using the ST_Reclass to create 3-band TIFF (for graphical
>> presentation) from 1 band grid 32BF (using algorithm described in
32BF
>>
http://postgis.refractions.net/documentation/manual-svn/RT_ST_Reclass.ht
>> ml)
>> The problem is, then for the mapping both intervals in (reclassexpr
>> text) must be increasing  - values from small to high is mapped to
>> colors from "small  to high" = (black to white for example) - and I
like
>> to have them in opposite order.
>> I am working with the big rasters (2000 x 2000 cells). In this case
the
>> ST_Reclass is already not very fast - and when I try to use map
algebra
>> it was very, very slow.
>> Did someone have idea how to speed up?
>
> Standa,
>
> Can you post your SQL?  I don't think there is anything restricting
> you from having your intervals from high to low instead of low to
> high, but I could be wrong.  ST_Reclass should be faster than
> ST_MapAlgebra as all evaluations are done in C instead of going back
> and forth with the PostgreSQL server.
>
> -bborie
>

-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list