Difference between revisions of "QGIS Change Attribute Type"

From Tuflow
Jump to navigation Jump to search
Line 5: Line 5:
  
  
 
+
<li> Firstly, Open your Shape in QGIS.<br>
 
 
<li>Open your Shape in QGIS.<br>
 
 
<li>Review the current field and data types in your table by right clicking on the layer in your layers panel and selecting Properties.<br>  
 
<li>Review the current field and data types in your table by right clicking on the layer in your layers panel and selecting Properties.<br>  
 
[[File:QGIS_Properties.png | 500px]]
 
[[File:QGIS_Properties.png | 500px]]

Revision as of 11:58, 15 May 2017

    This page shows you how to change an attribute data type in QGIS via Table Refactor Tool. For this example we are going to convert data type of the pBlockage field of a culverts 1d_nwk layer from 'double' to 'string' as needed for the AR&R blockage scenarios.

  1. Firstly, Open your Shape in QGIS.
  2. Review the current field and data types in your table by right clicking on the layer in your layers panel and selecting Properties.
    QGIS Properties.png

  3. Now click on the fields panel on the left hand side of the Layer Properties window.
    QGIS Field Pre Refactor.JPG

    Under the 'Table' dropdown menu goto Maintenance --> Table Structure as per the below image.
    QGIS Processing Toolbox.png
  4. Under the 'Table' dropdown menu goto Maintenance --> Table Structure as per the below image.
    QGIS Processing Toolbox.png

  5. Within the 'Modify Table Structure' you can select any of the attributes and modify the data type. Care needs to be taken to ensure that your data isn't truncated if you intend to use the existing data within that attribute. An example is shown below.
    QGIS Find Refactor.png]

  6. Once you've modified the attribute data type you can review it within the Type column as per the below. If happy with your modifications hit ok.
    QGIS Refactor.JPG]


  7. Once you've modified the attribute data type you can review it within the Type column as per the below. If happy with your modifications hit ok.
    QGIS Field Post Refactor.JPG]


    For more handy Mapinfo workflows, head back to the Mapinfo Tips and Tricks page.