[postgis-users] sorting st_geometryn

Puneet Kishor punk.kish at gmail.com
Mon Jul 23 15:47:22 PDT 2012


On Jul 23, 2012, at 5:26 PM, "Bob Pawley" <rjpawley at shaw.ca> wrote:

> Hi
>  
> I an collecting geometries as in this expression.
>  
> update num_search
>     set the_geom4 =
>     (select st_union(st_union(st_union(st_buffer(a.mbr, buff), st_buffer(b.mbr, buff)),
>         st_buffer(bob.face.mbr, buff)))   
>     from  bob.face a, bob.face b, num_search, bob.face
>     where (st_touches(a.mbr, b.mbr)
>     and st_intersects(a.mbr, num_search.the_geom2))
>     and st_intersects(bob.face.mbr, num_search.the_geom2));
>  
> When I reference the_geom4 with a geometry number st_geometryn, the numbers are in a random order. (example1,3,2,5,4,6)
>  
> Is there a method that can be used to sort them in either ascending or descending order??
>  
> 


Order in SQL query result is never guaranteed unless you use ORDER BY. 


--
Puneet Kishor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120723/7ba1becf/attachment.html>


More information about the postgis-users mailing list