[postgis-devel] SummaryStats

Paul Ramsey pramsey at opengeo.org
Tue Mar 6 14:21:45 PST 2012


Look, without reading the docs, I don't even *know* the contents of a
SummaryStats object. If the canonical form was "[key=value,
key=value]" then I would know what was inside, and could procede with
...

nevermind, I see that the type is user-defined in PostgreSQL so you
have no control over the canonical form...

CREATE TYPE summarystats AS (
	count bigint,
	sum double precision,
	mean double precision,
	stddev double precision,
	min double precision,
	max double precision
);

Sorry for the noise.

P.

On Tue, Mar 6, 2012 at 2:14 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca> wrote:
> If I do:
>
> SELECT (ss).min, (ss).max
> FROM (SELECT ST_SummaryStats(rast)) ss
>             FROM my table) foo
>
> what do I have to parse?
>
> I know (ss).min is the min and (ss).max is the max
>
> Pierre
>
>> -----Original Message-----
>> From: postgis-devel-bounces at postgis.refractions.net [mailto:postgis-devel-
>> bounces at postgis.refractions.net] On Behalf Of Paul Ramsey
>> Sent: Tuesday, March 06, 2012 5:11 PM
>> To: PostGIS Development Discussion
>> Subject: Re: [postgis-devel] SummaryStats
>>
>> You already have to parse it to reuse. No change there.
>> P.
>>
>> On Tue, Mar 6, 2012 at 2:03 PM, Pierre Racine <Pierre.Racine at sbf.ulaval.ca>
>> wrote:
>> > Then you have to parse to reuse?
>> >
>> >> -----Original Message-----
>> >> From: postgis-devel-bounces at postgis.refractions.net
>> >> [mailto:postgis-devel- bounces at postgis.refractions.net] On Behalf Of
>> >> Paul Ramsey
>> >> Sent: Tuesday, March 06, 2012 5:03 PM
>> >> To: PostGIS Development Discussion
>> >> Subject: Re: [postgis-devel] SummaryStats
>> >>
>> >> No, I'm referring to my example below... where the numbers have
>> >> little labels on them in the canonical output. Some kind of key/value
>> >> structure. Far more human-friendly.
>> >> Pierre's trick works to get something pretty but the canonical form
>> >> can be human readable so why not make it so.
>> >>
>> >> P.
>> >>
>> >> On Tue, Mar 6, 2012 at 1:56 PM, dustymugs <dustymugs at gmail.com> wrote:
>> >> > On 03/06/2012 01:46 PM, Paul Ramsey wrote:
>> >> >>
>> >> >> Raster seems to be full of these composite types, which are nice
>> >> >> enough for returning stuff, but I have a problem with the
>> >> >> canonical forms. Why is SummaryStats so anonymous?
>> >> >>
>> >> >> (65364,210241.004791319,3.21646479394345,,0,38.9035530090332)
>> >> >>
>> >> >> Why not something with tags so I can see what these things are?
>> >> >>
>> >> >> [sum=65364, min=210241.004791319, max=, etc]
>> >> >>
>> >> >> Could even go the JSON route.
>> >> >>
>> >> >
>> >> > Paul,
>> >> >
>> >> > When you say tagged, are you talking about something like the
>> >> > output of PostGIS_Full_version()?
>> >> >
>> >> > -bborie
>> >> >
>> >> > _______________________________________________
>> >> > postgis-devel mailing list
>> >> > postgis-devel at postgis.refractions.net
>> >> > http://postgis.refractions.net/mailman/listinfo/postgis-devel
>> >> _______________________________________________
>> >> postgis-devel mailing list
>> >> postgis-devel at postgis.refractions.net
>> >> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>> > _______________________________________________
>> > postgis-devel mailing list
>> > postgis-devel at postgis.refractions.net
>> > http://postgis.refractions.net/mailman/listinfo/postgis-devel
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list