[postgis-users] postgis collect() issue

Zhiqiang Zhang zqzhang01 at yahoo.com
Wed Jul 12 00:22:23 PDT 2006


I tried the suggestion with the following query but
got an error:

Query:
select collect(Geom(dump(the_geom))) as geom from
roads where the_geom && setSRID('BOX3D(-121.934769
37.355285,-121.894769 37.395285)'::BOX3D, -1) group by
name;

Error: set-valued function called in context that
cannot accept a set


--- strk at refractions.net wrote:

> collect() has changed in the 1.0 branch to never
> collapse
> structures. You can try collecting underlying
> multigeoms
> components, which should be done with something
> like:
> 
> 	collect(geom(dump(input)))
> 
> --strk;
> 
> On Tue, Jul 11, 2006 at 11:53:12AM -0700, Zhiqiang
> Zhang wrote:
> > The current postgis implementation of collect()
> > doesn't seem to work with mapserver. I am using
> > postgis 1.1.3, but actually the same happens to
> all
> > other 1.0 versions as well. The following is a
> > scenario:
> > 
> > Test SQL query (the_geom field is a
> MULTILINESTRING,
> > default type used by shp2pgsql):
> > 
> > select collect(the_geom) as geom from roads where
> > the_geom && setSRID('BOX3D(-121.934769
> > 37.355285,-121.894769 37.395285)'::BOX3D, -1)
> group by
> > name;
> > 
> > This query will return a GEOMETRYCOLLECTION of
> > MULTILINESTRING as follows:
> > 
> > GEOMETRYCOLLECTION(MULTILINESTRING((-121.909167
> > 37.35634,-121.911667
> > 37.354041)),MULTILINESTRING((-121.901967
> > 37.36404,-121.902167 37.36374)),...)
> > 
> > Mapserver won't be able to draw GEOMETRYCOLLECTION
> of
> > MULTILINESTRING but only GEOMETRYCOLLECTION of
> > LINESTRING. Applying the force_collection to the
> > output geometry doesn't have any effect. I had a
> > really old postgis prior to 0.9 the same query
> will
> > properly return a GEOMETRYCOLLECTION of
> LINESTRING,
> > which mapserver can draw. 
> > 
> > What is the solution for this? Is Mapserver still
> a
> > good combination to use with postgis or not?
> > 
> >  
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> >
>
http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> -- 
> 
>  /"\    ASCII Ribbon Campaign
>  \ /    Respect for low technology.
>   X     Keep e-mail messages readable by any
> computer system.
>  / \    Keep it ASCII. 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
>
http://postgis.refractions.net/mailman/listinfo/postgis-users
> 




More information about the postgis-users mailing list