[QGIS-trac] [Quantum GIS] #1597: Default sorting of data

Quantum GIS qgis at qgis.org
Thu Mar 26 15:22:24 EDT 2009


#1597: Default sorting of data
-----------------------------------------------+----------------------------
   Reporter:  mwtoews                          |              Owner:  nobody
       Type:  enhancement                      |             Status:  new   
   Priority:  minor: annoyance or enhancement  |          Milestone:        
  Component:  Data Provider                    |            Version:  HEAD  
   Keywords:                                   |   Platform_version:        
   Platform:  All                              |           Must_fix:  No    
Status_info:  0                                |  
-----------------------------------------------+----------------------------
 Presently, feature data are not sorted by QGIS. Also, databases do not
 return data in any particular order, unless explicitly sorted (e.g., "SORT
 BY field1 ASC, field2 DESC"). From a GIS perspective, this determines
 which features are drawn from first to last, which is noticeable if they
 are stacked (particularly polygons).

 I have worked around this limitation by building VIEWs in PostgreSQL:
 {{{
 CREATE OR REPLACE VIEW ordered_features AS
  SELECT gid, geometry, collection_date
    FROM features
    ORDER BY collection_date DESC;
 }}}
 and adding the metadata to geometry_columns.

 It would be of great convenience to be able to sort geometry features
 within QGIS. A potential solution for this is to add a field in Layer
 Properties > General, beneath Subset (aka "SQL where clause"). This could
 be a simple text field "SQL order clause" that gets inserted into the SQL
 statement when requesting data.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1597>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list