[QGIS-trac] [Quantum GIS] #1638: copy/paste of attributes/layers (merge) gives unexpected results(?)

Quantum GIS qgis at qgis.org
Wed Apr 8 13:07:04 EDT 2009


#1638: copy/paste of attributes/layers (merge) gives unexpected results(?)
------------------------------------------------+---------------------------
   Reporter:  lutra                             |              Owner:  timlinux     
       Type:  bug                               |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.0.2
  Component:  Build/Install                     |            Version:  HEAD         
   Keywords:                                    |   Platform_version:               
   Platform:  Debian                            |           Must_fix:  Yes          
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 A common definition of "Merge" of layers is the following:

 "Merge
 This geoprocess can work with many input layers. It merges all of these
 creating a new result layer which has a feature for each feature of all
 input layers. Because each input layer could have its own alphanumeric
 schema, user must select which layer will preserve its schema. The rest of
 input layers will only preserve those attributes whose name and type would
 be the same that an attribute of the input layer whose schema will be
 preserved."

 Actually seems to me that the only way to merge two or more layers in QGIS
 is to copy/paste (all the) features to an existing layer or to a new empty
 one.

 If we stand with the above definition the operation gives an unexpected,
 wrong, table of attributes.

 Example:

 layer A
 column name "codigo" type "integer" value "100"

 column name "apelido" type "string" value "evora"
 [[BR]]
 [[BR]]

 layer B
 column name "codigo" type "integer" value "200"

 column name "apelido" type "string" value "montemor"
 [[BR]]
 [[BR]]

 layer C
 column name "codice" type "integer" value "300"

 column name "cognome" type "string" value "parma"
 [[BR]]
 [[BR]]

 layer D
 column name "codigo" type "string" value "lisboa"

 column name "apelido" type "integer" value "400"
 [[BR]]
 [[BR]]

 if I copy/paste B to A the result is

 codigo              nome

 100                 evora

 200                 montemor

 and it is *right*

 [[BR]]
 [[BR]]



 if I copy/paste C to A the result is

 codigo              nome

 100                 evora

 300                 parma

 and it is *wrong*

 [[BR]]
 [[BR]]


 if I copy/paste D to A the result is

 codigo              nome

 100                 evora

 0                   400

 and it is *wrong* (in this last case it cannot copy the string value into
 an integer column but it makes to copy the integer value into a string
 column)
 [[BR]]
 [[BR]]
 [[BR]]



 tested on debian, ubuntu and windows xp

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