[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] ST_SummaryStatsAgg not working with PostgreSQL 9.3 + PostGIS 2.1.1
From:       Hailey Eckstrand <haileyeckstrand () gmail ! com>
Date:       2014-01-31 18:26:42
Message-ID: CABCgRVFa6hPV1biu_h5R8DC1ZsrGX1Dpym_DRa2F6d578fpmcw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you Bborie, it looks to be working successfully now.


On Fri, Jan 31, 2014 at 10:17 AM, Bborie Park <dustymugs@gmail.com> wrote:

> Put the following at the top of your file...
> 
> CREATE TYPE summarystats AS (
> count bigint,
> sum double precision,
> mean double precision,
> stddev double precision,
> min double precision,
> max double precision
> );
> 
> -bborie
> 
> 
> On Fri, Jan 31, 2014 at 9:41 AM, Hailey Eckstrand <
> haileyeckstrand@gmail.com> wrote:
> 
> > It was from a post on the PostGIS User Discussion that I made last year
> > from Pierre Racine:
> > 
> > http://lists.osgeo.org/pipermail/postgis-users/2013-August/037514.html
> > 
> > Is it possible to get this functionality working with PostGIS 2.1?
> > 
> > Thanks,
> > Hailey
> > 
> > 
> > On Fri, Jan 31, 2014 at 9:33 AM, Bborie Park <dustymugs@gmail.com> wrote:
> > 
> > > PostGIS 2.1 does not have the data type summarystats. Where did you get
> > > this function?
> > > 
> > > PostGIS 2.2 (in development now) does have that data type though for a
> > > built in ST_SummaryStatsAgg function.
> > > 
> > > -bborie
> > > On Jan 31, 2014 9:23 AM, "Hailey Eckstrand" <haileyeckstrand@gmail.com>
> > > wrote:
> > > 
> > > > Hi bborie,
> > > > 
> > > > After changing it from 'SQL' to 'sql' this is the error:
> > > > 
> > > > $psql mydb -f ST_SummaryStatsAgg.sql
> > > > 
> > > > psql:ST_SummaryStatsAgg.sql:50: ERROR:  type summarystats does not exist
> > > > psql:ST_SummaryStatsAgg.sql:56: ERROR:  type summarystats does not exist
> > > > psql:ST_SummaryStatsAgg.sql:77: ERROR:  type summarystats does not exist
> > > > psql:ST_SummaryStatsAgg.sql:86: ERROR:  type "summarystats" does not
> > > > exist
> > > > psql:ST_SummaryStatsAgg.sql:92: ERROR:  type "summarystats" does not
> > > > exist
> > > > CREATE FUNCTION
> > > > psql:ST_SummaryStatsAgg.sql:121: ERROR:  function
> > > > st_summarystatsagg(raster) does not exist
> > > > LINE 8: FROM (SELECT ST_SummaryStatsAgg(rast) as ss, id
> > > > ^
> > > > HINT:  No function matches the given name and argument types. You might
> > > > need to add explicit type casts.
> > > > 
> > > > 
> > > > Does PostgreSQL 9.3 still have the data type summarystats? Also, the
> > > > function that ST_SummaryStatsAgg.sql relies on, ST_SummaryStats.sql, has it
> > > > remained the same?
> > > > 
> > > > Thanks,
> > > > Hailey
> > > > 
> > > > 
> > > > 
> > > > On Fri, Jan 31, 2014 at 6:53 AM, Bborie Park <dustymugs@gmail.com>wrote:
> > > > 
> > > > > Can you change line 56 of that code from ...
> > > > > 
> > > > > $$ LANGUAGE 'SQL';
> > > > > 
> > > > > to
> > > > > 
> > > > > $$ LANGUAGE 'sql';
> > > > > 
> > > > > I believe PostgreSQL 9.3 (maybe 9.2) became case-sensitive with
> > > > > regards to the language.
> > > > > 
> > > > > -bborie
> > > > > 
> > > > > 
> > > > > 
> > > > > On Thu, Jan 30, 2014 at 4:41 PM, Hailey Eckstrand <
> > > > > haileyeckstrand@gmail.com> wrote:
> > > > > 
> > > > > > Hello,
> > > > > > I've got a new sandbox (Ubuntu 12.04) with a fresh install on
> > > > > > PostgreSQL 9.3 and the following for PostGIS version:
> > > > > > 
> > > > > > postgis_full_version
> > > > > > 
> > > > > > -------------------------------------------------------------------------- \
> > > > > > -----------------------------------------------------------------------------------------------------
> > > > > >  POSTGIS="2.1.1 r12113" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel.
> > > > > > 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" \
> > > > > > LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER
> > > > > > (1 row)
> > > > > > 
> > > > > > 
> > > > > > I just ran into a problem where I tried to run ST_SummaryStatsAgg on
> > > > > > a raster for a polygon and ended up with an error. I thought it was b/c I
> > > > > > did not have the function loaded, so when I tried to load the
> > > > > > function ST_SummaryStatsAgg.sql, I got the following errors:
> > > > > > 
> > > > > > psql:ST_SummaryStatsAgg.sql:50: ERROR:  type summarystats does not
> > > > > > exist
> > > > > > psql:ST_SummaryStatsAgg.sql:56: ERROR:  language "SQL" does not exist
> > > > > > psql:ST_SummaryStatsAgg.sql:77: ERROR:  type summarystats does not
> > > > > > exist
> > > > > > psql:ST_SummaryStatsAgg.sql:86: ERROR:  type "summarystats" does not
> > > > > > exist
> > > > > > psql:ST_SummaryStatsAgg.sql:92: ERROR:  type "summarystats" does not
> > > > > > exist
> > > > > > CREATE FUNCTION
> > > > > > psql:ST_SummaryStatsAgg.sql:121: ERROR:  function
> > > > > > st_summarystatsagg(raster) does not exist
> > > > > > LINE 8: FROM (SELECT ST_SummaryStatsAgg(rast) as ss, id
> > > > > > ^
> > > > > > HINT:  No function matches the given name and argument types. You
> > > > > > might need to add explicit type casts.
> > > > > > 
> > > > > > Here is the current ST_SummaryStatsAgg that I am trying to load:
> > > > > > 
> > > > > > http://hastebin.com/lujenosaro.pas
> > > > > > 
> > > > > > Thanks!
> > > > > > 
> > > > > > Hailey
> > > > > > 
> > > > > > _______________________________________________
> > > > > > postgis-users mailing list
> > > > > > postgis-users@lists.osgeo.org
> > > > > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> > > > > > 
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > postgis-users mailing list
> > > > > postgis-users@lists.osgeo.org
> > > > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> > > > > 
> > > > 
> > > > 
> > > > _______________________________________________
> > > > postgis-users mailing list
> > > > postgis-users@lists.osgeo.org
> > > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> > > > 
> > > 
> > > _______________________________________________
> > > postgis-users mailing list
> > > postgis-users@lists.osgeo.org
> > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> > > 
> > 
> > 
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users@lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> > 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 


[Attachment #5 (text/html)]

<div dir="ltr">Thank you Bborie, it looks to be working successfully now.</div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 10:17 \
AM, Bborie Park <span dir="ltr">&lt;<a href="mailto:dustymugs@gmail.com" \
target="_blank">dustymugs@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Put the following at the top of your \
file...<div><br></div><div><div>CREATE TYPE summarystats AS (</div> <div><span \
style="white-space:pre-wrap">	</span>count bigint,</div><div><span \
style="white-space:pre-wrap">	</span>sum double precision,</div>

<div><span style="white-space:pre-wrap">	</span>mean double \
precision,</div><div><span style="white-space:pre-wrap">	</span>stddev double \
precision,</div><div><span style="white-space:pre-wrap">	</span>min double \
precision,</div>


<div><span style="white-space:pre-wrap">	</span>max double \
precision</div><div>);</div></div><div><br></div><div>-bborie</div></div><div \
class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div \
class="gmail_quote"> On Fri, Jan 31, 2014 at 9:41 AM, Hailey Eckstrand <span \
dir="ltr">&lt;<a href="mailto:haileyeckstrand@gmail.com" \
target="_blank">haileyeckstrand@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">It was from a post on the PostGIS User \
Discussion that I made last year from Pierre Racine:<div><br></div>


<div><a href="http://lists.osgeo.org/pipermail/postgis-users/2013-August/037514.html" \
target="_blank">http://lists.osgeo.org/pipermail/postgis-users/2013-August/037514.html</a><br>
 </div><div><br></div><div>Is it possible to get this functionality working with \
PostGIS 2.1?</div><div><br></div><div>Thanks,</div><div>Hailey</div></div><div><div><div \
class="gmail_extra"><br><br>

<div class="gmail_quote">On Fri, Jan 31, 2014 at 9:33 AM, Bborie Park <span \
dir="ltr">&lt;<a href="mailto:dustymugs@gmail.com" \
target="_blank">dustymugs@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><p dir="ltr">PostGIS 2.1 does not have the data type \
summarystats. Where did you get this function?</p> <p dir="ltr">PostGIS 2.2 (in \
development now) does have that data type though for a built in ST_SummaryStatsAgg \
function.</p><span><font color="#888888"> <p \
dir="ltr">-bborie</p></font></span><div><div> <div class="gmail_quote">On Jan 31, \
2014 9:23 AM, &quot;Hailey Eckstrand&quot; &lt;<a \
href="mailto:haileyeckstrand@gmail.com" \
target="_blank">haileyeckstrand@gmail.com</a>&gt; wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">Hi bborie,<div><br><div>After changing it from &#39;SQL&#39; to \
&#39;sql&#39; this is the error: </div><div><br></div><div>$psql mydb -f \
ST_SummaryStatsAgg.sql</div><div><br></div><div>psql:ST_SummaryStatsAgg.sql:50: \
ERROR:  type summarystats does not exist</div>





<div>psql:ST_SummaryStatsAgg.sql:56: ERROR:  type summarystats does not \
exist</div><div>psql:ST_SummaryStatsAgg.sql:77: ERROR:  type summarystats does not \
exist</div><div>psql:ST_SummaryStatsAgg.sql:86: ERROR:  type &quot;summarystats&quot; \
does not exist</div>





<div>psql:ST_SummaryStatsAgg.sql:92: ERROR:  type &quot;summarystats&quot; does not \
exist</div><div>CREATE FUNCTION</div><div>psql:ST_SummaryStatsAgg.sql:121: ERROR:  \
function st_summarystatsagg(raster) does not exist</div>





<div>LINE 8: FROM (SELECT ST_SummaryStatsAgg(rast) as ss, id</div><div>               \
^</div><div>HINT:  No function matches the given name and argument types. You might \
need to add explicit type casts.</div><div><br>





</div><div><br></div><div>Does PostgreSQL 9.3 still have the data type summarystats? \
Also, the function that ST_SummaryStatsAgg.sql relies on, ST_SummaryStats.sql, has it \
remained the same?</div><div><br></div><div>Thanks,</div>





<div>Hailey</div><div><br></div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Fri, Jan 31, 2014 at 6:53 AM, Bborie Park <span \
dir="ltr">&lt;<a href="mailto:dustymugs@gmail.com" \
target="_blank">dustymugs@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
dir="ltr">Can you change line 56 of that code from ...<div>





<br></div>$$ LANGUAGE \
&#39;SQL&#39;;<div><br></div><div>to</div><div><br></div><div>$$ LANGUAGE \
&#39;sql&#39;;<br></div><div><br></div><div>I believe PostgreSQL 9.3 (maybe 9.2) \
became case-sensitive with regards to the language.</div>







<div><br></div><div>-bborie</div><div><br></div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, Jan 30, 2014 \
at 4:41 PM, Hailey Eckstrand <span dir="ltr">&lt;<a \
href="mailto:haileyeckstrand@gmail.com" \
target="_blank">haileyeckstrand@gmail.com</a>&gt;</span> wrote:<br>







</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div \
dir="ltr">Hello,<div> I&#39;ve got a new sandbox (Ubuntu 12.04) with a fresh install \
on PostgreSQL 9.3 and the following for PostGIS version:</div>

<div><div>                                                                            \
postgis_full_version</div> \
<div>--------------------------------------------------------------------------------- \
----------------------------------------------------------------------------------------------</div><div> \
POSTGIS=&quot;2.1.1 r12113&quot; GEOS=&quot;3.4.2-CAPI-1.8.2 r3921&quot; \
PROJ=&quot;Rel. 4.8.0, 6 March 2012&quot; GDAL=&quot;GDAL 1.10.1, released \
2013/08/26&quot; LIBXML=&quot;2.7.8&quot; LIBJSON=&quot;UNKNOWN&quot; TOPOLOGY \
RASTER</div>








<div>(1 row)</div></div><div><br></div><div><br></div><div>I just ran into a problem \
where I tried to run ST_SummaryStatsAgg on a raster for a polygon and ended up with \
an error. I thought it was b/c I did not have the function loaded, so when I tried to \
load the function ST_SummaryStatsAgg.sql, I got the following errors:</div>








<div><br></div><div><div>psql:ST_SummaryStatsAgg.sql:50: ERROR:  type summarystats \
does not exist</div><div>psql:ST_SummaryStatsAgg.sql:56: ERROR:  language \
&quot;SQL&quot; does not exist</div><div>psql:ST_SummaryStatsAgg.sql:77: ERROR:  type \
summarystats does not exist</div>








<div>psql:ST_SummaryStatsAgg.sql:86: ERROR:  type &quot;summarystats&quot; does not \
exist</div><div>psql:ST_SummaryStatsAgg.sql:92: ERROR:  type &quot;summarystats&quot; \
does not exist</div><div>CREATE FUNCTION</div><div>








psql:ST_SummaryStatsAgg.sql:121: ERROR:  function st_summarystatsagg(raster) does not \
exist</div><div>LINE 8: FROM (SELECT ST_SummaryStatsAgg(rast) as ss, id</div><div>    \
^</div><div>HINT:  No function matches the given name and argument types. You might \
need to add explicit type casts.</div>








</div><div><br></div><div>Here is the current ST_SummaryStatsAgg that I am trying to \
load:</div><div><br></div><div><a href="http://hastebin.com/lujenosaro.pas" \
target="_blank">http://hastebin.com/lujenosaro.pas</a><br></div>







<div><br></div>
<div>Thanks!</div><span><font \
color="#888888"><div><br></div><div>Hailey</div></font></span></div> \
<br></div></div>_______________________________________________<br> postgis-users \
mailing list<br> <a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
 <br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div></div></div>
 <br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div>
 </div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
 </div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
 </div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>




_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic