[QGIS-trac] [Quantum GIS] #1780: Lables: Data defined position from geometry column

Quantum GIS qgis at qgis.org
Wed Jul 15 04:11:12 EDT 2009


#1780: Lables: Data defined position from geometry column
-----------------------------------------------+----------------------------
   Reporter:  mwtoews                          |              Owner:  nobody
       Type:  enhancement                      |             Status:  new   
   Priority:  minor: annoyance or enhancement  |          Milestone:        
  Component:  MapCanvas                        |            Version:  HEAD  
   Keywords:                                   |   Platform_version:        
   Platform:  All                              |           Must_fix:  No    
Status_info:  0                                |  
-----------------------------------------------+----------------------------
 I would like to use a geometry (POINT) attribute to position label, using
 the example postgres schema:
 {{{
 CREATE TABLE region
 (
   gid serial NOT NULL,
   geometry geometry, -- SELECT
 AddGeometryColumn('public','region','geometry',26910,'POLYGON',2);
   label geometry, -- SELECT
 AddGeometryColumn('public','region','label',26910,'POINT',2);
   ...
 );
 }}}
 Here, there are two geometry columns: a polygon for the shape in the map,
 and a point to specify and store the label location.

 The present versions (1.0.1 to 1.2.0 unstable) support X/Y coordinates
 from two numeric columns. (This is found in Layer Properties > Labels >
 Data defined position).

 The enchantment requested in this ticket is to add another pull-down for a
 data defined position, which would be a geometry column. This seems more
 natural than defining two numeric columns for X and Y coordinates.

 I suggest first keeping it simple, supporting only POINT geometries.
 However, I can also envision enabling MULTIPOINT (for multiple places of
 the same label), and perhapps [MULTI]LINESTRING for text along a path
 (creeks, rivers) if the text fits the length. Furthermore, the centroid
 can easily be extracted from all other geometry types ([MULTI]POLYGONs,
 COLLECTIONs, etc.) to represent the coordinate for the label (i.e., this
 is the "else"/"default" case for other geometry types).

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1780>
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