On 28/04/2011 00:49, Hinkle, CJon wrote:

From: Micha Silver
Subject: Re: [Qgis-user] newbie question: grouping polygons in a shapefile

 


When you say "divide the counties" do you have the geographic boundaries of the districts is the second "table"?

 

No, I don’t have boundaries for the Districts, except as they include the individual counties.  Divide was a bad choice of terms.  I actually want to group the counties.  That is Counties 1 – 15 are District A, Counties 16 – 30 are District B etc.  Of course, they aren’t numbered, they are named.


Ah, OK. So you have a shapefile of counties and a table which looks like:

County    |    District

1        |    A

2        |    A

3        |    A

16        |    B

17        |    B

...


You can import the table into QGIS using the Add Vector Layer button. The table should be either in DBF or CSV format (or an sqlite table). Then, in the properties window of the counties layer go to the Join tab, and set up a join (click the +) between the counties attrib table and the Districts table. Both the Join field and the Target field should be county name. Now you should have in your attrib table an additional column of Districts. Next shift over to the Symbology tab in the counties layer properties windows, and set colors based on this column. Choose "Unique Value" for the Classification and "District" for the field to set a color for each District.

Hope that's clear.

In addition, you can export the joined layer to a new shapefile to have the Districts permanently part of the counties layer.


--

Micha



information on each county, but does not contain the District information.  I have a different table that contains the county name (identical to the original table) and the District designation (A, B, C etc)

 

I can’t find a way to import the second table into the project and sync it with the first, so I can then color District A red and District B green etc.

 

Can you add just the districts and color them all different colors?

 

That’s what I’m trying to do.  I could, for instance, add the district designations in a new column in the current DBF table, but my reading seems to indicate that this is not a good idea.

 

Thanks for your response,  CJon

 

 


This mail was received via Mail-SeCure System.


--

Hevra Logo

Micha



            Silver

Arava Development Co

052-3665918

http://www.surfaces.co.il

_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to