<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for the help everybody. I'll look into it tomorrow.<br>
<br>
On 2/22/2012 4:39 PM, John Callahan wrote:
<blockquote
cite="mid:CAL=axXns6QaGt0D=aEK7wbBwDnxteLcgRTb3cqPGNiDmKY1yYQ@mail.gmail.com"
type="cite">Steve,
<div><br>
</div>
<div>I had a similar issue. If you look at your list of functions
(say through pgAdmin), you'll probably see multiple instances of
that function. If the same function is listed more than once,
with the same number and type of arguments, then it will (I
think?) report as not unique. In that case, I manually deleted
the duplicate functions, and then added them back. To add them
back, look inside the rt_postgis.sql (or postgis.sql) file than
comes with the distribution (I'm using alpha5). you'll see all
of the functions in there. Just cut and paste the necessary
CREATE OR REPLACE statements for your functions into the Query
Tool or psql console window. </div>
<div><br clear="all">
<div>- John</div>
<div><br>
</div>
***********************************************<br>
John Callahan, Research Scientist<br>
Delaware Geological Survey, University of Delaware<br>
URL: <a moz-do-not-send="true" href="http://www.dgs.udel.edu"
target="_blank">http://www.dgs.udel.edu</a><br>
*************************************************<br>
<br>
<br>
<br>
<div class="gmail_quote">On Wed, Feb 22, 2012 at 4:28 PM, Bborie
Park <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bkpark@ucdavis.edu">bkpark@ucdavis.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Steve,<br>
<br>
I know enough to do my own testing and make the necessary
changes. Until I have the time to do so, the following
should work.<br>
<br>
CREATE OR REPLACE FUNCTION st_summarystats(rast raster,<br>
exclude_nodata_value boolean)<br>
RETURNS summarystats<br>
AS $$ SELECT _st_summarystats($1, 1, $2, 1.) $$<br>
LANGUAGE 'SQL' IMMUTABLE STRICT;<br>
<br>
-bborie<br>
<br>
On 02/22/2012 12:16 PM, Stephen Crawford wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Tried running it and get this:<br>
<br>
"ERROR: function _st_summarystats(raster, integer,
boolean, integer) is<br>
not unique<br>
LINE 3: AS $$ SELECT _st_summarystats($1, 1::int, $2, 1)
$$<br>
^<br>
HINT: Could not choose best candidate function. You might
need to add<br>
explicit type casts"<br>
<br>
-Steve<br>
<br>
On 2/22/2012 1:59 PM, Bborie Park wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Interesting. Can you run the following and try again?<br>
<br>
CREATE OR REPLACE FUNCTION st_summarystats(rast raster,<br>
exclude_nodata_value boolean)<br>
RETURNS summarystats<br>
AS $$ SELECT _st_summarystats($1, 1::int, $2, 1) $$<br>
LANGUAGE 'SQL' IMMUTABLE STRICT;<br>
<br>
If that removes the HINT, I'll make the appropriate
changes to the code.<br>
<br>
-bborie<br>
<br>
On 02/22/2012 10:48 AM, Stephen Crawford wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt
0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
I only tried the casting because of the messages I
get, on of which is:<br>
<br>
"function _st_summarystats($1, 1, $2, 1) is not
unique"<br>
and<br>
"HINT: Could not choose best candidate function. You
might need to add<br>
explicit type casts"<br>
<br>
Thanks,<br>
steve<br>
<br>
<br>
<br>
On 2/22/2012 1:41 PM, Bborie Park wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt
0pt 0.8ex; border-left: 1px solid rgb(204, 204,
204); padding-left: 1ex;">
Hey Steve,<br>
<br>
_st_summarystats is an underlying function that
isn't meant for use by<br>
end-users. ST_SummaryStats is what you should be
using.<br>
<br>
The example query you provided shouldn't have any
issues and shouldn't<br>
be creating any of those messages. In your
situation, you don't even<br>
need the true::boolean.<br>
<br>
-bborie<br>
<br>
On 02/22/2012 10:34 AM, Stephen Crawford wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt
0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
204, 204); padding-left: 1ex;">
Should I have both _st_summarystats and
st_summarystats in my<br>
database?<br>
I get messages like "function not unique" and
"could not choose best<br>
candidate function" when doing this:<br>
<br>
SELECT rid, observation_date,
ST_SummaryStats(rast::raster,<br>
true::boolean) FROM spring_ms WHERE
observation_date = '2012-02-20';<br>
<br>
I expected to get 187 records (one for each tile).<br>
<br>
Thanks,<br>
Steve<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<font color="#888888">
<br>
-- <br>
Bborie Park<br>
Programmer<br>
Center for Vectorborne Diseases<br>
UC Davis<br>
<a moz-do-not-send="true" href="tel:530-752-8380"
value="+15307528380" target="_blank">530-752-8380</a><br>
<a moz-do-not-send="true" href="mailto:bkpark@ucdavis.edu"
target="_blank">bkpark@ucdavis.edu</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:postgis-users@postgis.refractions.net"
target="_blank">postgis-users@postgis.refractions.net</a><br>
<a moz-do-not-send="true"
href="http://postgis.refractions.net/mailman/listinfo/postgis-users"
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</font></blockquote>
</div>
<br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
<a class="moz-txt-link-abbreviated" href="mailto:src176@psu.edu">src176@psu.edu</a>
814.865.9905</pre>
</body>
</html>