Monday 3 June 2019

QGIS Attributes null after copy paste


I have QGIS 2.14.


I opened a .shp file (with dbf etc) and selected a few features. Created a new QGIS project and pasted features as new Vector Layer.


The attributes table was created automatically in correct schema (field names & types) however the values are NULL.


I have explored other questions on stackexchange but they seem to be focusing on schema or field definition problem, in my case the schema is exactly same but still NULL values appearing.


Any ideas ?



Answer



The safest way to load some selected features into a new project file is to save the selected features first into a new shapefile, then load the selected shapefile into the new QGIS project document.


To do that




  • Select the targeted features from the original shapefile

  • Right-click the layer from which you select the features -> Go to Save as

  • Check the "Save only selected features" located under Encoding, as you can see in the image below


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...