Monday, 7 December 2015

QGIS classifying vector data


I am trying to classify a shapefile based on rule set, following this tutorial.



This is the result: enter image description here


What I want to ask is: 1. How to insert the classification result (water, land etc) into the attribute table? I want to make each feature assign to a certain class in the attribute table. enter image description here



  1. How to join the vector contain same class? I tried vector-geoprocessing-dissolve, it is not working. I tried to select the polygons using same rule, then using "merge selected feature". However, the attributes value only following the first feature, meanwhile, I need the mean of each feature. Is there any way to merge the same category, and calculate the mean attributes value?



Answer





  1. you have to do it by edit your attribut table first (Field Calculator) to put value on your class column, use conditional statement CASE based on the "rule" that you used in classification. you can take a look on this to use CASE.





  2. After your Class Column is filled. Then you can run Split vector layer from processing toolbox. Input the vector layer , then input Class as Unique ID field.




Addition : To join features into one feature per Class, Dissolving based on your "class" Field also will do this logically.


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...