[postgis-users] Retrieve variables values from nested function

Hugues François hugues.francois at irstea.fr
Mon Sep 23 03:58:22 PDT 2013


Hello 

ST_Collect IS an aggregate function : if you want to call with other columns you should choose an aggregate way. The question is : what do you want to collect ? Or how do you want to merge your geometries ?

If you want to keep row and col information, you may want to use st_collect() over() (take a look at window function for more information).

To return only path or geometry from st_dump you can also use a syntax like (st_dump()).path or (st_dump()).geom.

HTH

Hugues.


-----Original Message-----
From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of car271
Sent: Monday, September 23, 2013 12:33 PM
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] Retrieve variables values from nested function

Hi all,

i've a function, ST_CreateFishnet, who returns 3 variables: geom, row and col.

My goal is retrieve variables values "row" and "col" where ST_CreateFishnet is nested like query below:

SELECT dump.geom FROM ST_Dump(ST_SetSRID(ST_Rotate((SELECT
ST_Collect(cells.geom), cells.row, cells.col FROM ST_CreateFishnet(10, 20, 1.2, 0.6, 498320.705,4783932.452) AS cells), ((pi()/2) - (ST_Azimuth(ST_Point(498320.705,4783932.452),
ST_Point(498344.646,4783932.501)))), 498320.705,4783932.452), 32631)) as dump.

When i execute previous query, i get this error:

column "cells.row" must appear in the GROUP BY clause or be used in an aggregate function.

What i wrong?

Regards.

car271 



--
View this message in context: http://postgis.17.x6.nabble.com/Retrieve-variables-values-from-nested-function-tp5004263.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list