2

is there a way to merge the attribute table of a csv file into a the attribute table of a vector? Join is not the answer for me because in this way the plugin GroupStats that you suggested me to use for counting the elements in the table doesn't work properly; in fact I need to count accommodations for every municipality in my province and using Join feature between municipality vector and accommodation file doesn't count the number of the elements that I need.

4

I didn't test it it, but I think the MMQGIS plugin can merge a CSV and a vector layer (go to the Attribute Join from CSV File section):

enter image description here

It should output a vector layer with the attributes of the original layer and the CSV file, joined according to a field.

4

You can use the Count Points in Polygon process from the Vector->Analysis -> Points in Polygon menu.

enter image description here

You simply put your municipality layer in as the polygon layer, and the accommodation as the point layer. Select an output shapefile and then run it.

Finally you can merge the file back into your municipalities if you need to.

  • Thank you, but in this way I get a column with the sum of the accommodations in each municipality, I need to know how many hotels, B&Bs, hostels, etc.. there are in each of them.. Is this possible? – Stefano Citterio Apr 21 '16 at 16:59
  • Try selecting the category you want before you do the join – Ian Turton Apr 21 '16 at 17:36
  • sorry, in which menu? – Stefano Citterio Apr 21 '16 at 17:38
2

It's somewhat circuitous, but you may have luck saving a copy of the vector file after you Join the CSV to it. That way, the exported file should contain all of the CSV attributes without it being connected through a Join. Perhaps that would help address the issues you're encountering when using the plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.