[postgis-users] ST_SummaryStatsAgg not working with PostgreSQL 9.3 + PostGIS 2.1.1

Bborie Park dustymugs at gmail.com
Fri Jan 31 10:17:47 PST 2014


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 at 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 at 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 at 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 at 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 at 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 at lists.osgeo.org
>>>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at lists.osgeo.org
>>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>>
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140131/08a0edcb/attachment.html>


More information about the postgis-users mailing list